Created
April 4, 2013 03:24
-
-
Save atomize/5307448 to your computer and use it in GitHub Desktop.
php in js in html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript"> | |
var myData = Array(); //create the blank array variable | |
//now add values to the array from PHP | |
<?php | |
echo " myData[0] = '" . $variable1 . "';"; | |
echo " myData[1] = '" . $variable2 . "';"; | |
echo " myData[2] = '" . $variable3 . "';"; | |
?> | |
</script> | |
</head> | |
<body> | |
..document body... | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment