like this?
PHP Code:
if (in_array(substr($allfiles[$currentFile], -3), array('gif','jpg','png')))
echo '<img src="'.$allfiles[$currentFile].'">';
else
{
$get_content = file_get_contents($allfiles[$currentFile]);
echo $get_content;
}
that code should replace these 2 lines:
PHP Code:
$get_content = file_get_contents($allfiles[$currentFile]);
echo $get_content;
Be careful though, if you're not sure where your image files are from, you should check the image type first with getimagesize function.
ps. when I preview my reply, I saw there's a reply already, but I send mine anyway because I had typed it
Bookmarks