It's been really frustrating me i have this code:
<script type ="text/javascript">
scriptAr = new Array(); // initializing the javascript array
<?php
foreach ($docsannlist as $subdocs)
{
$lines = $subdocs; // read file values as array in php
$count = count($subdocs); //this gives the count of array
//In the below lines we get the values of the php array one by one and update it in the script array.
foreach ($lines as $line)
{
print "scriptAr.push(\"$line\");
"; // This line updates the script array with new entry
}
}
?>
document.write(scriptAr);
</script>
and for some reason its just not working. Please help!