javascript access php variable
snippet in javascript

javascript access php variable

user298

//passing PHP variable to JavaScript
var myJSVar = <?php echo json_encode($myPHPVar); ?>;