3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ["/?dfs1=frgs1","/?dfs2=frgs2","/?dfs3=frgs3"]; $matches = preg_grep("/\/\?(.*)\=(.*)/", $a); $fmatchs = []; foreach($matches as $match){ $mtchs = explode("=", $match); print($match); print_r($mtchs); foreach($mtchs as $v){ echo "dddd".$v[0]; $k = str_replace("/?", "", $v[0]); $fmatchs[$k] = $v[1]; } } print_r($fmatchs);

preferences:
58.67 ms | 402 KiB | 5 Q