0
How do you make a php variable a javascript variable?
2 Answers
+ 2
php: $variable;
javascript: var variable;
0
<html>
<head>
<?php
$phpVar = 2016;
?>
<script>
var jsVar = <? echo $phpVar ?>;
</script>
</head>
<body>
<body>
</html>