且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

http_build_query具有相同的名称参数

更新时间:2023-02-25 15:27:45

这应该做你想要的,我有一个需要相同的api。

This should do what you want, I had an api that required the same thing.

$vars = array('foo' => array('x','y'));
$query = http_build_query($vars, null, '&');
$string = preg_replace('/%5B(?:[0-9]|[1-9][0-9]+)%5D=/', '=', $query); //foo=x&foo=y