glob can't find the images in automatic image gallery
Posted: Fri May 20, 2011 8:13 am
Hello,
i have just started with the tutorial automatic image gallery part one. I am this far now.
When i chance the image variable in
it gives the php files back, Array([0]=>fotogallery.php[1]=>phpinfo.php), but no images.
What am i do wrong?
i have just started with the tutorial automatic image gallery part one. I am this far now.
<?php if (is_dir('./fotoalbum/thumbs')===false){ mkdir('./fotoalbum/thumbs',0744); } $images = glob('*.{jpg,jpeg,png,gif}',GLOB_BRACE); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>fotogallery</title> <style type="text/css"> a, img {float:left; } </style> </head> <body> <div> <?php print_r($images); ?> </div> </body> </html>But the script gives an empty array back, Array().
When i chance the image variable in
$images = glob('*.*');
it gives the php files back, Array([0]=>fotogallery.php[1]=>phpinfo.php), but no images.
What am i do wrong?