i need person can me create url http://www.saqaw.com/allads/other-ladys-fashion/page=1 not this
http://www.saqaw.com/allads/?ad=other%20ladys%20fashion&page=1
it general question quick url parser may you:
$url = "http://www.saqaw.com/allads/?ad=other%20ladys%20fashion&page=1"; $url = parse_url($url); $queries = explode("&", $url['query']); $newurl = $url['host'] . $url['path']; foreach ($queries $query) { $querycontent = explode("=", $query); $querycontent[0] == "ad"? $newurl .= str_replace("%20", "-", $querycontent[1]):$newurl .= "/".$query; } echo $newurl; result
www.saqaw.com/allads/other-ladys-fashion/page=1 however if looking more general purpose url parse can use script below:
$url = "http://www.saqaw.com/allads/?ad=other%20ladys%20fashion&page=1"; $url = parse_url($url); $queries = explode("&", $url['query']); $newurl = $url['host'] . $url['path']; foreach ($queries $query) { $querycontent = explode("=", $query); $newurl .= $querycontent[0] . "/" . str_replace("%20", "-", $querycontent[1]) . "/"; } echo $newurl; result
www.saqaw.com/allads/ad/other-ladys-fashion/page/1/ however above scripts quick fixed , not include security or script injection.
Comments
Post a Comment