RE: [PHP] Dir? Can I get a dir listing of the current dir my php file is in?

From: Date: Sat, 17 Feb 2001 18:00:00 +0000
Subject: RE: [PHP] Dir? Can I get a dir listing of the current dir my php file is in?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-40369@lists.php.net to get a copy of this message
Another solutions is: $script_name = getenv("PATH_TRANSLATED"); $dir_name = dirname($script_name); // $arFiles will be an array of filenames exec( "ls -1 $dirname", $arFiles ) foreach( $arFiles as $cFile ) { print( $cFile ); } Joseph E. Sheble a.k.a. Wizaerd Wizaerd's Realm Canvas, 3D, Graphics, ColdFusion, PHP, and mySQL http://www.wizaerd.com ================================= > -----Original Message----- > From: Ifrim Sorin [mailto:sifrim@rsb.ro] > Sent: Saturday, February 17, 2001 5:46 AM > To: Brandon Orther; PHP User Group > Subject: Re: [PHP] Dir? Can I get a dir listing of the current dir my > php file is in? > > > Hi, > > You could try this: > > $script_name = getenv("PATH_TRANSLATED"); > $dir_name = dirname($script_name); > $d = dir($dir_name); > $i = 0; > while ($file = $d->read()) > > $file_array[i] = $file ; > } > > HTH > Sorin Ifrim > > > ----- Original Message ----- > From: Brandon Orther <brandon@webintellects.com> > To: PHP User Group <php-general@lists.php.net> > Sent: Saturday, February 17, 2001 5:03 AM > Subject: [PHP] Dir? Can I get a dir listing of the current dir my php file > is in? > > > > Hello, > > > > I am looking for a way to get a dir listing of the current dir my > phpscript > > is in and putting it into an array. Does anyone have a quick way to do > > this? > > > > Thank you, > > > > -------------------------------------------- > > Brandon Orther > > WebIntellects Design/Development Manager > > brandon@webintellects.com > > 800-994-6364 > > www.webintellects.com > > -------------------------------------------- > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > >

« previous php.general (#40369) next »