Re: How to get the files names from the folder using PHP ..
- From: "Steve" <no.one@xxxxxxxxxxx>
- Date: Tue, 23 Oct 2007 10:19:19 -0500
"anu" <anunanni2006@xxxxxxxxx> wrote in message
news:1193129945.656683.280660@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
How to get the files names from the folder using PHP .. is there any
specific command.
if yes let me know that..
see if this helps:
function listFiles($path = '.', $extension = array(), $combine = false)
{
$wd = getcwd();
$path .= substr($path, -1) != '/' ? '/' : '';
if (!chdir($path)){ return array(); }
if (!$extension){ $extension = array('*'); }
if (!is_array($extension)){ $extension = array($extension); }
$extensions = '*.{' . implode(',', $extension) . '}';
$files = glob($extensions, GLOB_BRACE);
chdir($wd);
if (!$files){ return array(); }
$list = array();
foreach ($files as $file)
{
$list[] = ($combine ? $path : '') . $file;
}
return $list;
}
.
- References:
- Prev by Date: Re: PUNCHING JERRY STUCKLE IN THE FACE
- Next by Date: Re: PUNCHING JERRY STUCKLE IN THE FACE
- Previous by thread: How to get the files names from the folder using PHP ..
- Next by thread: How to get the files names from the folder using PHP ..
- Index(es):
Relevant Pages
|