I am trying to declare javascript variables from php array values using a loop.
Trying to declare javascript var h1 as php array value from $array[1][h], and h2 as $array[2][h], and h3 as $array[3][h],and so on...
Here is my code:
<SCRIPT LANGUAGE="JavaScript">
for (var i=0;i<61;i++)
{
var h[i] = "<?php echo $array[i][h] ?>";
var hl[i] = "<?php echo $array[i][hl] ?>";
var hs[i] = "<?php echo $array[i][hs] ?>";
}
</script>
When I <script type="text/javascript"> document.write(h1); </script> it is blank