Re: Parsing URLs

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

 



On Mon, Oct 27, 2008 at 10:04 PM, Ron Piggott
<ron.php@xxxxxxxxxxxxxxxxxx> wrote:
> I would like to parse the URLs in the values after the domain name.
>
> The URLs are the results of mod re-write statements.
>
> Example 1:
>
> http://www.domain.com/page/file/
>
> The desired results would be:
> $web_page_access[1] = "file"
>
> Example 2:
>
> http://www.domain.com/page/file/2/
>
> The desired results would be:
> $web_page_access[1] = "file"
> $web_page_access[2] = "2"
>
> Any help please?
>
> Ron
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

// $uri = htmlspecialchars($SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8');
$uri = htmlspecialchars('/page/file/2/', ENT_QUOTES, 'UTF-8');;
$uri = trim($uri, "/");
$parts = explode("/", $uri);
var_dump($parts);

or use parse_url to get down to the bits you need.

-- 
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