PHP gets the parameters at the specified location in the URL
PHP Gets the parameters for the location specified in the URL, because the parameters after the URL are variable. How to get it? such as www.xxx.com?act=game&st=play&b1=1&round=1, sometimes this URL will be output to www.xxx.com?act=game&st=play&b2=2 &round=1, of which B1, B2, B3 .... All the way to B15. How do i get the URL output of B1 or B2 or the other and his values?
------to solve the idea----------------------
outputting the query string to an array is fine.
------to solve the idea----------------------
Access by name
$s = ' www.xxx.com?act=game&st=play&b1=1&round=1 ';
Parse_str (@array_pop (Explode ('? ', $s)), $a);
Print_r ($a);
$s = ' www.xxx.com?act=game&st=play&b2=2&round=1 ';
Parse_str (@array_pop (Explode ('? ', $s)), $a);
Print_r ($a);
Array
(
[act] = Game
[St] = + Play
[B1] = 1
[Round] = 1
)
Array
(
[act] = Game
[St] = + Play
[B2] = 2
[Round] = 1
)
------to solve the idea----------------------
Parse_str
Http://www.w3school.com.cn/php/func_string_parse_str.asp