NYCPHP Meetup

NYPHP.org

[nycphp-talk] alternate to scandir()

Dell Sala dell at sala.ca
Sun Jul 29 14:49:13 EDT 2007


On Jul 29, 2007, at 2:35 PM, selyah wrote:

> $dir=$_SERVER['DOCUMENT_ROOT']."coles/admin/new_images/".$_FILES 
> ['image']['name'];
> $files=scandir($dir);
>
> is there an alternate syntax to writing this function call in  
> version 4.3.10? and wher can i find a link to a manual for this  
> version?

Try using glob() instead. You'll probably use it something like this:

$fileList = glob($dir.'/*');

http://us3.php.net/manual/en/function.glob.php

BTW: something looks funny with your line that computes "$dir". Is  
$dir supposed to be a file or a directory?

-- Dell





More information about the talk mailing list