3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = "bla.php?test1=a&test2=b&test1=c&test2=d&test1=e&test2=f&test1=g&test2=h&test1=i&test2=j"; function getToArray($url, $key) { $values = array(); list (, $query_string) = explode('?', $url, 2); foreach (explode('&', $query_string) as $param) { list($k, $v) = explode('=', $param, 2); if ($k == $key) $values[] = $v; } return $values; } print_r(getToArray($url, 'test1')); print_r(getToArray($url, 'test2'));
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => a [1] => c [2] => e [3] => g [4] => i ) Array ( [0] => b [1] => d [2] => f [3] => h [4] => j )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
18.69 ms | 401 KiB | 8 Q