<?php
//scan "uploads" folder and display them accordingly
$scan = scandir('uploads');
foreach($scan as $file)
{
if (is_image("uploads/$file"))
{ ?>
<p><?php echo "this is an image"; ?></p>
<?php
}
if (is_pdf("uploads/$file"))
{ ?>
<p><?php echo "this is an PDF file"; ?></p>
<?php
}
if (is_html("uploads/$file"))
{ ?>
<p><?php echo "this is an HTML file"; ?></p>
<?php
}
}
?>
I want to display the file as file type. If the file is an image show this is an image, if the file is PDF show the file is PDF Please Help me with this code. Pls, Pls