3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = ' John David James (DEM) . . . . . . 7,808 10.51 Marvin D. Scott (DEM) . . . . . . 6,548 9.55 Maria "Mary" Williams (DEM) . . . . 4,551 8.58 Dwayne R. Johnson. . . . . . . . 4,322 8.22 WRITE-IN. . . . . . . . . . . 188 .29'; preg_match_all("/\s*(.*?)\s*\. \..*?([\d,]+)/", $str, $matches); foreach($matches[1] as $key => $name){ $new[] = $name . "," . str_replace(",", "", $matches[2][$key]); } Var_dump($new);
Output for git.master, git.master_jit, rfc.property-hooks
array(5) { [0]=> string(27) "John David James (DEM),7808" [1]=> string(26) "Marvin D. Scott (DEM),6548" [2]=> string(32) "Maria "Mary" Williams (DEM),4551" [3]=> string(22) "Dwayne R. Johnson,4322" [4]=> string(12) "WRITE-IN,188" }

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:
20.63 ms | 402 KiB | 8 Q