Php Code : How To Show Filenames Using Scandir
________________________________________________________
I Use In This Tutorial:
- NetBeans IDE .
- XAMPP .
In this Php Tutorial we will Learn How To Use Scandir To Display Files Names 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);
print_r($files);
echo"<br>";
for($i = 0; $i < count($files); $i++)
{
if($files[$i] != '.' && $files[$i] != '..')
{
echo "File $i -> $files[$i]<br>";
}
}
}
Bagikan
Php : How To Use Scandir To Show Files Names
4/
5
Oleh
insurance