Answers for "how to change php variable value in javascript"

PHP
0

how to change javascript value to php value

<script> 
  document.cookie = "js_var = " + This is used to chang js to php 
</script>
<?php
    $php_var= $_COOKIE['js_var'];
	echo $php_var;
?>
Posted by: Guest on June-09-2021
0

how to change php variable value in javascript

<?php
$php_var = "This is used to change php values to js";
?>
<script>
var js_var = '<?php echo $php_var ;?>';
document.write(js_var);
</script>
Posted by: Guest on June-09-2021

Code answers related to "how to change php variable value in javascript"

Browse Popular Code Answers by Language