0

How do you make a php variable a javascript variable?

24th Jul 2016, 12:28 AM
Jason Mace
2 Answers
+ 2
php: $variable; javascript: var variable;
24th Jul 2016, 3:19 AM
Felipe Medeiros
Felipe Medeiros - avatar
0
<html> <head> <?php $phpVar = 2016; ?> <script> var jsVar = <? echo $phpVar ?>; </script> </head> <body> <body> </html>
2nd Nov 2016, 4:03 PM
Hasan Al-Yazidi
Hasan Al-Yazidi - avatar