Php Code: How To Show Files Extension From A Folder Using Php
________________________________________________________
I Use In This Tutorial:
- NetBeans IDE .
- XAMPP .
In this Php Tutorial we will Learn How To Display Files Extensions From Folder Using Php .
I Use In This Tutorial:
- NetBeans IDE .
- XAMPP .
Php Source Code:
<?php
$dir_path = "folder/";
if(is_dir($dir_path))
{
$files = scandir($dir_path);
for($i = 0; $i < count($files); $i++)
{
if($files[$i] !='.' && $files[$i] != '..')
{
echo "File Name -> $files[$i]<br>";
$file = pathinfo($files[$i]);
$extension = $file['extension'];
echo "File Extension -> $extension<br><br>";
}
}
}
Bagikan
Php : How To Get File Extension From Directory Using Php
4/
5
Oleh
insurance