Answers for "how to declare a variable in javascript with the value of php"

PHP
10

javascript php variable

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

how to assign value of a js variable to a php variable

<script> document.cookie = "myJavascriptVar = " + myJavascriptVar </script>
<?php
     $myPhpVar= $_COOKIE['myJavascriptVar'];
?>
Posted by: Guest on May-04-2020

Code answers related to "how to declare a variable in javascript with the value of php"

Browse Popular Code Answers by Language