Why am I getting an error stating that $image is not an array? And also I want to be able to sort the picture/files in the $image. I want to sort them by the time they were uploaded. First uploaded gets ontop of my page. These two issues have I been struggling with.
$files = glob("Pictures/*.*");
for ($i=0; $i<count($files); $i++)
{
$image = $files[$i];
sort($image);
$supported_file = array(
'gif',
'jpg',
'jpeg',
'png'
);
$ext = strtolower(pathinfo($image, PATHINFO_EXTENSION));
if (in_array($ext, $supported_file)) {
echo basename($image)."<br />";
echo '<img src="'.$image .'" alt="Random image" height="150" />';
echo '<div class="content_wrapp">