Re: URL parsing
| From: | Jaxon | Date: | Sun, 25 Mar 2001 18:34:27 +0000 |
| Subject: | Re: URL parsing | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-45501@lists.php.net to get a copy of this message | ||
Any way to combine both forms of url parsing?
I want to use standard slash notation for navigation ,but also account for
the occasional variable used within a single page.
e.g. URL can be either:
domain.com/index.php/main/index.html?ii=1
or:
domain.com/index.php/main/index.html?ii=1
if (isset($ii) // how do I grab value and truncate $REQUEST_URI
$path_array = explode('/', $REQUEST_URI);
$page_name = array_pop($path_array); //get page name from end of array
$page_type = array_pop($path_array); //get page type from next item
best regards,
jaxon
On 3/23/01 9:09 PM, "Aaron Tuller" <mandelbaum@olywa.net> wrote:
> super easy.
>
> $path_array = explode('/', $REQUEST_URI);
> $numPathElements = count($path_array);
>
> then loop through the elements and do what you need, you might need
> to use strtok() if you're expecting slashes in your arguments.
>
> -aaron
>
> At 8:58 PM -0500 3/23/01, Jaxon wrote:
>> how about parsing a url from passing variables like :
>> test.php/op/3/op2/6/pagename.html
>>
>> cannot this be parsed, to let search engines spider past the "?" properly?
>>
>> regards,
>> jaxon