Hello reader!
There are mane ways to pass a variable from one technology to another technology but if you do want to use PHP, always encode with json_encode before outputting.
lets see this quick example
<script>
var jsvariable = <?php echo json_encode($phpvariable); ?>;
</script>
0 Comment(s)