NYCPHP Meetup

NYPHP.org

[nycphp-talk] alternate to scandir()

Andy Dirnberger dirn at dirnonline.com
Sun Jul 29 15:08:54 EDT 2007


As Ben stated, scandir is only available in PHP 5.  As you stated, you are using PHP 4.

The manual page to which Ben linked provides an alternative to the scandir function for users of PHP 4.

Sent via BlackBerry by AT&T

-----Original Message-----
From: selyah <selyah1 at yahoo.com>

Date: Sun, 29 Jul 2007 11:57:38 
To:NYPHP Talk <talk at lists.nyphp.org>
Subject: Re: [nycphp-talk] alternate to scandir()


hello:
i looked at that link before and i think that i was entering it that way, yet i am still getting that warning.......should the function be declared somewhere before?

"Ben Sgro (ProjectSkyLine)" <ben at projectskyline.com> wrote:    
Hello,  
  
According to php.net: 
http://us2.php.net/manual/en/function.scandir.php <http://us2.php.net/manual/en/function.scandir.php>  
scandir 
(PHP 5) 
Is only available in php5. 
  
- Ben 
 
  
Ben Sgro, Chief Engineer
ProjectSkyLine - Defining New Horizons
 
Our company: www.projectskyline.com
Our products: www.project-contact.com <http://www.project-contact.com>  
  
This e-mail is confidential information intended only for the use of the individual to whom it is addressed.  
----- Original Message -----  
From: selyah <mailto:selyah1 at yahoo.com>   
To: talk at lists.nyphp.org <mailto:talk at lists.nyphp.org>   
Sent: Sunday, July 29, 2007 2:35 PM 
Subject: [nycphp-talk] alternate to scandir() 

I am currently using PHP version 4.3.10 and need a bit of help.  I created a script to display images in a directory.  part of the script is shown here :

$dir=$_SERVER['DOCUMENT_ROOT']."coles/admin/new_images/".$_FILES['image']['name'];
$files=scandir($dir);

this opens the directory and an returns an array of files and directories found within the folder.  The array is assigned to $files.

the problem is that when i execute the file, i am getting this  warning:

"Call to undefined function: scandir()...."    and points to this line: $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?
thanks
 
 
----------------
 
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php
 _______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php


More information about the talk mailing list