note 33674 added to ref.filesystem
| From: | l_domenech at yahoo dot ca | Date: | Thu, 03 Jul 2003 15:25:13 +0000 |
| Subject: | note 33674 added to ref.filesystem | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-51466@lists.php.net to get a copy of this message | ||
In the code samples of the user-contributed notes, you'll find functions that sometimes need a
slash at the end of a folder path and sometimes don't.
Here's a little function to append a slash at the end of a path if there isn't one
already.
function append_slash_if_none($string)
{
if (ereg ("/$", $string))
{
return $string;
}
else
{
return ereg_replace("$", "/", $string);
}
}
(Replace with a backslash if you're on Windows...)
----
Manual Page -- http://www.php.net/manual/en/ref.filesystem.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33674
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33674&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33674&report=yes