Answers for "how to access variable inside a js in php"

PHP
3

using js variable in php

<script type="text/javascript">
var abc= 'this is text';
<?php $abc = "<script>document.write(abc)</script>"?>   
</script>
<?php echo $abc;?>
Posted by: Guest on June-10-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 access variable inside a js in php"

Browse Popular Code Answers by Language