note 86507 added to function.dirname
| From: | ricardo dot ferro at gmail dot com | Date: | Wed, 22 Oct 2008 15:11:16 +0000 |
| Subject: | note 86507 added to function.dirname | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-145595@lists.php.net to get a copy of this message | ||
dirname can be used to fix paths:
function fixPath ($path)
(
return dirname($path . '/.');
)
fixPath('/one') // '/one'
fixPath('/one/') // '/one'
fixPath('/one//two') // '/one/two'
fixPath('/one////two////') // '/one/two'
----
Server IP: 200.185.126.110
Probable Submitter: 200.162.59.125
----
Manual Page -- http://www.php.net/manual/en/function.dirname.php
Edit -- https://master.php.net/note/edit/86507
Del: integrated -- https://master.php.net/note/delete/86507/integrated
Del: useless -- https://master.php.net/note/delete/86507/useless
Del: bad code -- https://master.php.net/note/delete/86507/bad+code
Del: spam -- https://master.php.net/note/delete/86507/spam
Del: non-english -- https://master.php.net/note/delete/86507/non-english
Del: in docs -- https://master.php.net/note/delete/86507/in+docs
Del: other reasons-- https://master.php.net/note/delete/86507
Reject -- https://master.php.net/note/reject/86507
Search -- https://master.php.net/manage/user-notes.php