Re: Finding the depth
| From: | Christian Reiniger | Date: | Fri, 16 Mar 2001 10:39:25 +0000 |
| Subject: | Re: Finding the depth | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-44243@lists.php.net to get a copy of this message | ||
On Thursday 15 March 2001 16:51, you wrote:
> ok, this is what you asked for
>
> <?php
>
> function depth()
> {
> global $PHP_SELF;
>
> $count = count_chars($PHP_SELF);
>
> for($c = 0; $c < $count[ord('/')]; $c++)
> $return[] = "..";
>
> if (isset($return))
> return implode('/', $return);
> }
Won't work for the (perfectly valid) URL
http://somewhere.de/lvl1////lvl2//lvl3/foo.bar
it's quite unlikely though that someone enters such a thing
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
Google results 1-10 of about 142,000,000 for e. Search took 0.18 seconds.
- http://www.google.com/search?q=e