Any use of PHP for thsi will involve making requests to the server - because that's where PHP runs - and having a response sent back.
Search the forums for things like Javascript variables to find threads on various approaches to this. Restricting the search to titles only nets 18 hits.
But there's no reason for IE5 not to use script tags if they're complete:
<script language="Javascript" type="text/javascript" src="foo.js">
unless Javascript is turned off completely.