php in js file

php in js file

Java script should be in an external js file otherwise wont be valid html.

I have lots of dynamic values in my javascript that I generate with php.

What is the best way to use php in .js file?

Thanks