note 94891 added to function.realpath

From: Date: Tue, 01 Dec 2009 12:08:20 +0000
Subject: note 94891 added to function.realpath
Groups: php.notes 
Request: Send a blank email to php-notes+get-163445@lists.php.net to get a copy of this message
if you just need to resolve a path that is not on your system, or you don't want to chdir to it, a simple regular expression can do the trick: <?php $p = '/cool/yeah/../zzz'; $p = preg_replace('/\w+\/\.\.\//', '', $p); echo $p; //outputs /cool/zzz ?> ---- Server IP: 69.147.83.197 Probable Submitter: 188.81.110.238 ---- Manual Page -- http://www.php.net/manual/en/function.realpath.php Edit -- https://master.php.net/note/edit/94891 Del: integrated -- https://master.php.net/note/delete/94891/integrated Del: useless -- https://master.php.net/note/delete/94891/useless Del: bad code -- https://master.php.net/note/delete/94891/bad+code Del: spam -- https://master.php.net/note/delete/94891/spam Del: non-english -- https://master.php.net/note/delete/94891/non-english Del: in docs -- https://master.php.net/note/delete/94891/in+docs Del: other reasons-- https://master.php.net/note/delete/94891 Reject -- https://master.php.net/note/reject/94891 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#163445) next »