3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '20\' Container 1, 40\' Open Container 1, 40-45\' Closed Container 3, container roll 10, container lift 50'; preg_match_all('/(\d*\'*)\s([a-zA-Z ]+)(\d+)/', $str, $matches); unset($matches[0]); $res =[]; foreach($matches[1] as $key => $val){ $res[] = array_column($matches, $key); } var_dump($res);
Output for git.master, git.master_jit, rfc.property-hooks
array(5) { [0]=> array(3) { [0]=> string(3) "20'" [1]=> string(10) "Container " [2]=> string(1) "1" } [1]=> array(3) { [0]=> string(3) "40'" [1]=> string(15) "Open Container " [2]=> string(1) "1" } [2]=> array(3) { [0]=> string(3) "45'" [1]=> string(17) "Closed Container " [2]=> string(1) "3" } [3]=> array(3) { [0]=> string(0) "" [1]=> string(15) "container roll " [2]=> string(2) "10" } [4]=> array(3) { [0]=> string(0) "" [1]=> string(15) "container lift " [2]=> string(2) "50" } }

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:
159.08 ms | 407 KiB | 5 Q