On Wed, 2006-09-06 at 11:03 -0600, Ashley M. Kirchner wrote:
> Robert Cummings wrote:
> > It's because you have written sloppy code and didn't bother to
> > initialize $Dirs to an array. So it's default value is null. You would
> > know this if you had notices enabled.
> >
> Error fixed.
>
Robert Cummings wrote:
It's because you have written sloppy code and didn't bother to
initialize $Dirs to an array. So it's default value is null. You would
know this if you had notices enabled.
Error fixed.
Also, the other problem is that you are either a) opening the wrong
path, b) t
On Wed, 2006-09-06 at 10:47 -0600, Ashley M. Kirchner wrote:
> Given this piece of code:
>
> $i = 0;
> if ($dir = opendir($path)) {
> while ($dh = readdir($dir)) {
> if ($dh != '.' && $dh != '..') {
> $Dirs[$i] = $dh;
> $i++;
> }
> }
> }
> closedir($
Given this piece of code:
$i = 0;
if ($dir = opendir($path)) {
while ($dh = readdir($dir)) {
if ($dh != '.' && $dh != '..') {
$Dirs[$i] = $dh;
$i++;
}
}
}
closedir($dir);
sort($Dirs);
Why does sort() give me the following warning:
PHP Warning: sort(
4 matches
Mail list logo