I need to assign the list of all files of a directory (site_img) to a javascript array but not getting any luck.Can any one pls help .
i:e In the below code I want to assign the value of filename to an javascript array in each iteration of the for loop.
<?php
foreach(glob('./site_img/*.*') as $filename){
echo $filename;
echo "<br>";
}
?>