how to type php codes in js file code example
Example 1: how to write php in script file
<script type="text/javascript" src="YourFunctions.js"></script>
<script type="text/javascript">
functionOne(<?php echo implode(', ', $arrayWithVars); ?>);
functionTwo(<?php echo $moreVars; ?>, <?php echo $evenMoreVars; ?>);
</script>
Example 2: how to write php in script file
phpVars["value1"]
phpVars["value2"]