Re: note 27897 added to function.dirname
| From: | Jesus M. Castagnetto | Date: | Tue, 24 Dec 2002 04:47:43 +0000 |
| Subject: | Re: note 27897 added to function.dirname | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-41241@lists.php.net to get a copy of this message | ||
BTW, dirname() does the job your code tries to
accomplish. I put an editor's note to that respect in
yours.
Let me know if you want your note modified or removed
in any way.
--- djphillips@sbcglobal.net wrote:
> If you need to print a URI i.e. /~yourdir/files
> instead of an absolute path i.e.
> /home/apache/htdocs/~yourdir/files I use the
> following code:
>
> <?
> $self = $PHP_SELF; //Translates as
> /~yourdir/files/file.php
> $filename = strrchr("$self", "/"); //Returns
> /file.php
> $uri = str_replace("$filename","","$self");
> //Searches self and
> echo "$uri"; //Returns the current URI
> ?>
>
> feel free to email me if needed.
> --
> http://www.php.net/manual/en/function.dirname.php
>
http://master.php.net/manage/user-notes.php?action=edit+27897
>
http://master.php.net/manage/user-notes.php?action=delete+27897
>
http://master.php.net/manage/user-notes.php?action=reject+27897
>
>
> --
> PHP Notes Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
=====
--- Jesus M. Castagnetto <jmcastagnetto@php.net>
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com