note 74530 added to function.realpath
| From: | aszlig at osu1 dot php dot net | Date: | Mon, 16 Apr 2007 09:14:27 +0000 |
| Subject: | note 74530 added to function.realpath | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125434@lists.php.net to get a copy of this message | ||
this won't traverse preceding directories, but it will remove all
unnecessary things like multiple slashes and dot-shlashes:
<?php
preg_replace( '!((^|/+)\.)*/*(?=((/\.?)*$)|/)!', '', $path );
?>
----
Server IP: 217.160.72.57
Probable Submitter: 84.155.159.76
----
Manual Page -- http://www.php.net/manual/en/function.realpath.php
Edit -- https://master.php.net/note/edit/74530
Del: integrated -- https://master.php.net/note/delete/74530/integrated
Del: useless -- https://master.php.net/note/delete/74530/useless
Del: bad code -- https://master.php.net/note/delete/74530/bad+code
Del: spam -- https://master.php.net/note/delete/74530/spam
Del: non-english -- https://master.php.net/note/delete/74530/non-english
Del: in docs -- https://master.php.net/note/delete/74530/in+docs
Del: other reasons-- https://master.php.net/note/delete/74530
Reject -- https://master.php.net/note/reject/74530
Search -- https://master.php.net/manage/user-notes.php