Hello,
I'm having problems figuring out how to exclude hidden files when building an image array. I'm using a regex to validate the image, should I use another regex for hidden files instead of strtok()?
function get_after_thumbs()
{
$dir = get_dir();
$afterdir = $dir . 'after/thumbs/';
$files = scandir($afterdir);
foreach($files as $value) {
// check for image files
if(valid_image_file($value))
if(!strtok($value, '._'))
// build image array
$imgarr[] = $value;
}
$count = count($imgarr);
for ($i=0; $i<$count; $i++) {
echo '<img class="floatright" src="' . $dir . 'after/thumbs/' . $imgarr[$i] . '" width="25" height="25" alt="09 285" />';
}
var_dump($imgarr);
}
Thanks,
Jason