I occasionally come across pages where some Javascript is included via a PHP file:
It makes it easy to set javascript variables from the server side.
var foo = =$foo?>
I usually have one php/javascript file in my projects that I use define any variables that need to be used in javascript. That way I can access constants used on the server-side (css colors, non-sensitive site properties, etc) easily in javascript.
Edit: For example here's a copy of my config.js.php
file from the project I'm currently working on.