How do I get a list of the first file of every subfolder?
This is what i have so far
<?php
function getfirstImage($ dirname)
{
global $imageName;
$ext = array("jpg", "png", "jpeg", "gif", "JPG", "PNG", "GIF",
"JPEG");
if($handle = opendir($dirnam e))
{
while(false!== ($file = readdir($handle )))
{
if(strstr($file , "." . $ext[$i])!= '.' && strstr($file, "." .
$ext[$i])!= '..')
{
break;
}
}
$imageName = $file;
closedir($handl e);
}
return($imageNa me);
}
echo getfirstImage(' ../galleri/galleri/diverse/');
?>
$getfirstImage( ../galleri/galleri/)
This is what i have so far
<?php
function getfirstImage($ dirname)
{
global $imageName;
$ext = array("jpg", "png", "jpeg", "gif", "JPG", "PNG", "GIF",
"JPEG");
if($handle = opendir($dirnam e))
{
while(false!== ($file = readdir($handle )))
{
if(strstr($file , "." . $ext[$i])!= '.' && strstr($file, "." .
$ext[$i])!= '..')
{
break;
}
}
$imageName = $file;
closedir($handl e);
}
return($imageNa me);
}
echo getfirstImage(' ../galleri/galleri/diverse/');
?>
$getfirstImage( ../galleri/galleri/)
Comment