note 41066 modified in function.copy by vrana
| From: | vrana@php.net | Date: | Tue, 17 Aug 2004 14:55:23 +0000 |
| Subject: | note 41066 modified in function.copy by vrana | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-79865@lists.php.net to get a copy of this message | ||
An improved version of ls_a from objobj at hotmail dot com:
PHP no longer complains about undefined $files variable.
<?php
function ls_a($wh)
{
$files_array = array();
if ($handle = opendir($wh)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." ) {
array_push($files_array, $file);
}
}
closedir($handle);
}
return $files_array;
}
?>
--was--
An improved version of ls_a from objobj at hotmail dot com:
PHP no longer complains about undefined $files variable.
function ls_a($wh)
{
$files_array = array();
if ($handle = opendir($wh)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." ) {
array_push($files_array, $file);
}
}
closedir($handle);
}
return $files_array;
}
http://php.net/manual/en/function.copy.php