Before Starting...
Know about file location
My File exist
in C:\xampp\htdocs\ftp\index.php
In ftp directory we
have 6 more directories names are :
- John
- Jill
- Cafe
- Monit
- Rifle
- Kim.
<?php
$ar = array();
$directory = "./";
$files = glob($directory . "*", GLOB_ONLYDIR );
foreach($files as $file)
{
$ar[] = basename($file);
}
$a =count($ar);
for($i=0;$i<$a;$i++)
{
echo $ar[$i]."<br>";
}
Output Will be
John
Jill
Cafe
Monit
Rifle
Kim.
No comments:
Post a Comment