Answers for "how to get javascript variables in php code"

PHP
10

javascript php variable

<script type="text/javascript">
   var php_var = "<?php echo $php_var; ?>";
</script>
Posted by: Guest on March-20-2020
6

javascript access php variable

//passing PHP variable to JavaScript
var myJSVar = <?php echo json_encode($myPHPVar); ?>;
Posted by: Guest on August-05-2019

Code answers related to "how to get javascript variables in php code"

Browse Popular Code Answers by Language