|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi, How to get the files names from the folder using PHP .. is there any specific command. if yes let me know that.. Thanks, Anu |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
"anu" <anunanni2006@gmail.com> wrote in message news:1193129945.656683.280660@k35g2000prh.googlegr oups.com... > > 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 s: 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; } |
|
![]() |
| Outils de la discussion | |
|
|