Powered By Blogger

Tuesday, 8 February 2011

Parse the URL


Lets take a simple example of an URL with some attached Query string
WWW. Facebook.com?&src=india&sid=2748472&ver=2hqhwu&height=123

so as u see that now if you need  to use these parameters those have come to you in the form of a query string you  have to parse them down so here is  what you can try

$src = urldecode($_GET['src']);

$sid = urldecode($_GET['sid']);

$ver = trim(urldecode($_GET['ver']));

$height = urldecode($_GET['h']);





here we are using the urlencode() function to convert the values of the $_GET[] global array in human readable form

No comments:

Post a Comment