What is the \"less code needed\" way to get parameters from a URL query string which is formatted like the following?
www.mysite.com/category/subcateg
Thanks to @K. Shahzad This helps when you want the rewrited query string without any rewrite additions. Let say you rewrite the /test/?x=y to index.php?q=test&x=y and you want only want the query string.
function get_query_string(){
$arr = explode("?",$_SERVER['REQUEST_URI']);
if (count($arr) == 2){
return "";
}else{
return "?".end($arr)."
";
}
}
$query_string = get_query_string();