Re: What am I missing here?
| From: | Simcha Younger | Date: | Mon, 21 Jun 2010 06:59:12 +0000 |
| Subject: | Re: What am I missing here? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-306281@lists.php.net to get a copy of this message | ||
On Sat, 19 Jun 2010 13:21:02 -0400
Rick Dwyer <rpdwyer@earthlink.net> wrote:
> Hello List.
>
> I am completely at a loss for why the line of code below returns the
> desired value:
>
> $PATH_INFO= substr($_SERVER['REQUEST_URI'],strlen($_SERVER['SCRI
> PT_NAME']), strlen($_SERVER['REQUEST_URI']));
>
> BUT, putting the same line of code on 1 line fails to return anything:
>
> $PATH_INFO=
> substr($_SERVER['REQUEST_URI'],strlen($_SERVER['SCRIPT_NAME']),
> strlen($_SERVER['REQUEST_URI']));
>
>
>
> --Rick
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
It looks like since you broke your key in the first line, the value returned is 0, since the key
'SRI PT_NAME' does not exist.
When you fixed this, SCRIPT_NAME was the same length as REQUEST_URI so nothing was returned.
look at the documentation on substr, you need to fix you parameters.
--
Simcha Younger <simcha@syounger.com>