rapier_gv
May 14th, 2007, 03:09 PM
hi all, i'm not much of a php guru, so here's my question
i have created a very basic script which shows the content of a certain directory like so
if ($myDir = opendir('.')) {
while (false !== ($file = readdir($myDir))) {
if ($file != "." && $file != "..") {
echo "$file<br />\n";
}
}
closedir($myDir);
}and now the silly and probably noobish question: how can i convert the list of contents from the directory to an array?
thanks
i have created a very basic script which shows the content of a certain directory like so
if ($myDir = opendir('.')) {
while (false !== ($file = readdir($myDir))) {
if ($file != "." && $file != "..") {
echo "$file<br />\n";
}
}
closedir($myDir);
}and now the silly and probably noobish question: how can i convert the list of contents from the directory to an array?
thanks