Php How To Get All Files Names From A Folder
________________________________________________________
I Use In This Tutorial:
- NetBeans IDE .
- XAMPP .
In this Php Tutorial we will see How To Retrieve All Files Names In A Directory Using Php .
I Use In This Tutorial:
- NetBeans IDE .
- XAMPP .
Php Source Code:
<?php
$dir_path = "folder/";
$options = "";
if(is_dir($dir_path))
{
$files = opendir($dir_path);
{
if($files)
{
while(($file_name = readdir($files)) !== FALSE)
{
if($file_name != '.' && $file_name != '..')
{
// select option with files names
$options = $options."<option>$file_name</option>";
// display the file names
echo $file_name."<br>";
}
}
}
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>PHP GET List Of FILES NAMES FROM A Directory </title>
</head>
<body>
<select>
<?php echo $options;?>
</select>
</body>
</html>
Update Contact :
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email : Fajarudinsidik@gmail.com
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email: Fajarudinsidik@gmail.com
atau Kirimkan Private messanger melalui email dengan klik tombol order dibawah ini :