Re: Parse URL parameters

From: Date: Thu, 05 Jul 2001 07:32:56 +0000
Subject: Re: Parse URL parameters
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-56275@lists.php.net to get a copy of this message
$vars = array(); $url2 = explode("?", $url); $url3 = explode("&", $url2[1]); for($i=0;$i<sizeof($url3);$i++) { $url4 = explode("=", $url3[$i]); array_push($vars, array($url4[0], $url4[1])); } for($i=0;$i<sizeof($vars);$i++) { echo $vars[$i][0]."=".$vars[$i][1]; } ?> - James "ReDucTor" Mitchell ----- Original Message ----- From: Andy <andreas.felder@felderweb.ch> To: <php-general@lists.php.net> Sent: Thursday, July 05, 2001 5:19 PM Subject: [PHP] Parse URL parameters > How can I parse parameters sent with the URL of an pgp site? > > Example: I call the site with > http://www.server.xyz/sub/site.php?a1=123&a2=312 > How can I get the values of a1 and a2? > > Thanks, folks! > Andy. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#56275) next »