note 62608 added to function.dirname
| From: | borisallan at socialenquiry dot org | Date: | Sat, 04 Mar 2006 23:52:09 +0000 |
| Subject: | note 62608 added to function.dirname | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-104837@lists.php.net to get a copy of this message | ||
I needed to refer to a directory, one up the tree, so that I had an explicit rather than relative
anchor. I couldn't find a function, so I invented:
$DocName = "http://" . $_SERVER['SERVER_NAME'] .
$_SERVER['PHP_SELF'];
$DirNow = dirname($DocName);
$DirUp = dirname($DirNow);
which seems to work.
Cheers. BoRiS.
----
Server IP: 216.194.113.175
Probable Submitter: 138.88.84.147
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.dirname.php
Edit -- http://master.php.net/note/edit/62608
Del: integrated -- http://master.php.net/note/delete/62608/integrated
Del: useless -- http://master.php.net/note/delete/62608/useless
Del: bad code -- http://master.php.net/note/delete/62608/bad+code
Del: spam -- http://master.php.net/note/delete/62608/spam
Del: non-english -- http://master.php.net/note/delete/62608/non-english
Del: in docs -- http://master.php.net/note/delete/62608/in+docs
Del: other reasons-- http://master.php.net/note/delete/62608
Reject -- http://master.php.net/note/reject/62608
Search -- http://master.php.net/manage/user-notes.php