Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to write php in script file

<script type="text/javascript">
var phpVars = { 
<?php 
  foreach ($phpToJsVars as $key => $value) {
    echo '  ' . $key . ': ' . '"' . $value . '",' . "
";  
  }
?>
};
</script>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #write #php #script #file
ADD COMMENT
Topic
Name
4+2 =