August 17, 201016 yr hello, I was wondering if anyone can tell me why this script won't allow me to show my images? <?php $files = glob("/1m/{*.gif,*.jpg,*.png}", GLOB_BRACE); for ($i=1; $i<=count($files); $i++) { $num = $files[$i]; echo '<img src="'.$num.'" alt="1minute">'." "; } ?> The script will work if I put an image in the same folder as my .php file $files = glob("*"); But I want my image in another director, or only upload .jpg files. Thanks
August 17, 201016 yr You path looks wrong to me. / is the filesystem root, I presume it should be $files = glob("1m/{*.gif,*.jpg,*.png}", GLOB_BRACE); If you are trying to get images from inside the 1m directory (providing that directory is in the same directory as the PHP script)
Create an account or sign in to comment