3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function uri_to_array($uri){ $result = array(); var_dump(strpos($uri, '?')); if ($pos = strpos($uri, '?') !== false) { $pos++; } else { $pos = 0; } parse_str(substr($uri, (int) $pos), $result); return $result; } print_r( uri_to_array('asd?sub_page=products&action[]=add&action[]=remove') );
based on TIfKj
Output for 4.3.0 - 7.2.0
int(3) Array ( [sd?sub_page] => products [action] => Array ( [0] => add [1] => remove ) )