is there a function available with PHP to insert html into the HEAD of an HTML document?
For example inserting javascript between the HEAD tags.
If you need to include javascript dynamicly, use php to build the html page and use a switch. If it is static, don't use php and just use
<SCRIPT Language="Javascript" src="clientdetect.js"></SCRIPT>
Ok, I'm with you.. Here's the scenario.
php document 1 executes and gets data from php document 2. php document 2 gets data from database and builds javascript array variables that need to be defined in the head of php document 1. Kinda like tripod.com's add javascript code that is forced into their user's pages. But these javascript array variables are used throughout php document 1 so that less access to the database is needed.
build your pages like this, using embedded php, or even better, use templates (read articles here on phpbuilder for templating).
doc1.html:
<head> <? include("doc2.inc");?> </head> <body> </body>