gte a javascript value in php string code example
Example: javascript access php variable
//passing PHP variable to JavaScript
var myJSVar = <?php echo json_encode($myPHPVar); ?>;
//passing PHP variable to JavaScript
var myJSVar = <?php echo json_encode($myPHPVar); ?>;