use php in js file code example
Example 1: how to write php in script file
phpVars["value1"]
phpVars["value2"]
Example 2: how to write php in script file
AddType application/x-httpd-php .js
AddHandler x-httpd-php5 .js
<FilesMatch "\.(js|php)$">
SetHandler application/x-httpd-php
</FilesMatch>