Created
July 12, 2011 01:38
-
-
Save ctrl-freak/1077223 to your computer and use it in GitHub Desktop.
PHP $url_parts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$url=str_replace('.html','',$_GET['u']); | |
$page_url=$url; | |
$args=array(); | |
if(strstr($url,'?')) | |
{ | |
$url=explode('?',$url); | |
$tmp=$url[1]; | |
$tmp=explode('&',$tmp); | |
foreach($tmp as $t) | |
{ | |
list($name,$value)=explode('=',$t); | |
$args[$name]=$value; | |
} | |
$url=$url[0]; | |
} | |
$url=ereg_replace('^/|/$','',$url); | |
$url=str_replace('-','_',$url); | |
$page['url']=$url; | |
$url_parts=explode('/',$url); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment