Convert a php variable into a javascript variable
1 2 3 4 5 6 7 8 9 10 |
<?php $boardnamex = "dailystats"; ?> <script> var newboardname = "<?php echo $boardnamex ?>"; alert(newboardname); </script> |
and if not passing try this
1 2 3 4 5 6 7 8 9 10 |
<?php $wasamountx = 101.34; $newamountx = 150.98; ?> <script> var wasamount = <?php echo $wasamountx ?>; var newamount = <?php echo $newamountx ?>; </script> |