Created
July 13, 2012 15:40
-
-
Save jakiestfu/3105558 to your computer and use it in GitHub Desktop.
pip.php
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
//if($request_url)... | |
// Save GET queries | |
$parsedUrl = parse_url(home_url($request_url)); | |
if($parsedUrl['query']){ | |
$queries = explode('&',$parsedUrl['query']); | |
foreach($queries as $query){ | |
$queryInfo = explode('=',$query); | |
$_GET[$queryInfo[0]]=end($queryInfo); | |
} | |
} | |
// Split the url into segments | |
$segments = explode('/', $url); | |
for($i=0;$i<count($segments);$i++){ | |
if(stripos($segments[$i], '?')!==false){ | |
$segments[$i] = substr($segments[$i], 0, stripos($segments[$i], '?')); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment