how to change javascript value to php value

Solutions on MaxInterview for how to change javascript value to php value by the best coders in the world

showing results for - "how to change javascript value to php value"
Riccardo
07 Jun 2020
1<script> 
2  document.cookie = "js_var = " + This is used to chang js to php 
3</script>
4<?php
5    $php_var= $_COOKIE['js_var'];
6	echo $php_var;
7?>
Alexandria
14 May 2017
1<?php
2$php_var = "This is used to change php values to js";
3?>
4<script>
5var js_var = '<?php echo $php_var ;?>';
6document.write(js_var);
7</script>