note 47126 added to function.opendir
| From: | steffendotilleatupgrade-networksdot at osu1 dot php dot net | Date: | Wed, 03 Nov 2004 23:33:03 +0000 |
| Subject: | note 47126 added to function.opendir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-79571@lists.php.net to get a copy of this message | ||
Two things which are maybe trivial but also useful, hopefully...
First: You can also use opendir() with e.g. "./images" as a relative path to directories.
Second: For the "problem" with Win32 you can get the right directory seperator e.g. with
this litte code:
<?
if(strpos(PHP_OS,'WIN')!==FALSE)
{ $seperator='\\'; }
else
{$seperator='/'; }
?>
Trivial but useful because you don't have to rewrite your script for the Linux/Unix
platforms...
----
Manual Page -- http://www.php.net/manual/en/function.opendir.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47126
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47126&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47126&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47126&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47126&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47126&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47126&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47126&report=yes
Search -- http://master.php.net/manage/user-notes.php