PHP API - Copying Headers and Footers

How do copy the header/footer from one document to another using the PHP API?

The only examples I can find are not PHP.

Thank you.