oops :)
http://www.domain.com/index.php/main/index.html?ii=1
versus
http://www.domain.com/index.php/main/index.html
I want to get "index.html" and "main" into variables, as the two items will
always be present - if $ii is set, I want to strip it from the URI before
parsing the items out.
I suppose with parse_url() I could do something..but I really only want to
deal with the URI.
currently, this seems to work:
$path_array = explode('/', $REQUEST_URI);
if (isset($ii)) array_pop($path_array); // remove $ii
$page_name = array_pop($path_array); //get page name from end of array
$tpl = array_pop($path_array); //get page type from next item
but is inelegant :)
regards,
jaxon
> In article <[EMAIL PROTECTED]>,
> [EMAIL PROTECTED] (Jaxon) wrote:
>
>> 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
>
> Umm, how are these different?
>
> (If you're trying to extract info from a url, perhaps
> parse_url(),basename(), and/or dirname() are what you're seeking...?)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]