1
explode url
CGuild1.com > Tips & Tricks > explode url

Explode a URL and Seperate The Info

I like to work with clean URL\'s. This is easier for users to remember and better for search engine crawling.

clean url example: http://cguild1.com/that/this/

dirty url example: http://cguild1.com/that.php?this=that&that=this )

Here is the code to do just that.

$url = explode("/", $_SERVER["PATH_INFO"]);
    $protype = $url[1];
    $minp = $url[2];
    $maxp = $url[3];
    $area = $url[4];


I dont remeber exactly how I got this, so I can not give proper credit.
©2024 CGuild1.com