[Solved] Variable Not Working With Glob Function In Php [closed]


foreach(glob($select) as $filename){
    echo $filename;
    echo "<a class="vlightbox1" href="https://stackoverflow.com/questions/17947191/$filename" title="https://stackoverflow.com/questions/17947191/$filename"><img src="https://stackoverflow.com/questions/17947191/$filename" style="height:120px; width:160px; alt="https://stackoverflow.com/questions/17947191/$filename"></a>";
    echo "<a href="ap_deleteimages.php?id=$filename">Delete</a>";
}

You have the syntax error at glob function in your code. The right syntax is in above code.

Second thing is that glob() is used to find all the search pathname matching a pattern. So you need to check that the value of $select is correct or not.

Read more above glob() function.

10

solved Variable Not Working With Glob Function In Php [closed]