Php 用于url解析的正则表达式

Php 用于url解析的正则表达式,php,url-parsing,Php,Url Parsing,如何解析此urlhttp://site.com/forum.php?id=1&page.php?id=1像这样 ( [0] => http://site.com/forum.php [1] => 1 [2] => &page.php [3] => 1 [4] => &next.php [5] => 2 ) 正则表达式I一直像这样被卡住,“/\?(.*?=/I”,输出像这样: ( [0] => http://site.com/forum.

如何解析此url
http://site.com/forum.php?id=1&page.php?id=1
像这样

(
[0] => http://site.com/forum.php
[1] => 1
[2] => &page.php
[3] => 1
[4] => &next.php
[5] => 2
)
正则表达式I一直像这样被卡住,
“/\?(.*?=/I”
,输出像这样:

(
[0] => http://site.com/forum.php
[1] => 1&page.php
[2] => 1&next.php
[3] => 2
)

你想然后。此外,该URL的格式不正确,因为只能有一个
。感谢您的帮助。我将学习这个函数