3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $p = array('order_status' => array('google','facebook'), 'agent' => array('ffff')); function bqs($array, $qs='',$index = false) { foreach($array as $par => $val) { if($index) $par = $index; if(is_array($val)) { $qs .= bqs($val, $qs,$par); } else { $qs .= $par.'='.$val.'&'; } } return $qs; } echo bqs($p);
based on aJlNR
Output for 4.3.0 - 7.1.0
order_status=google&order_status=facebook&order_status=google&order_status=facebook&agent=ffff&