Re: What am I missing here?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 19 Jun 2010 13:21:02 -0400
Rick Dwyer <rpdwyer@xxxxxxxxxxxxx> 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@xxxxxxxxxxxx>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux