I'm trying to display images from folder. When I run my script I get following error -
"Only variables should be passed by reference in C:\wamp\www\salon\mainS\image_delete.php on line 72"
CODE:
<?php
$dir = 'uploads/';
$display = array('jpg', 'jpeg', 'png', 'gif');
if (file_exists($dir) == false) {
echo 'Directory \''. $dir. '\' not found!';
} else {
$dir_contents = scandir($dir);
foreach ($dir_contents as $file) {
$type = strtolower(end(explode('.', $file)));
if ($file !== '.' && $file !== '..' && in_array($type, $display) == true)
{
echo'<div style="width:1170px;" >'.
'<div style="float:left; margin-right:5px;" >'.'<img style="width:200px; height:200px;"src="'. $dir. '/'. $file. '" alt="'. $file.'"/>'.'</div>'
.'</div>';
}
}
}
?>
my line 72 is
$type = strtolower(end(explode('.', $file)));