3v4l.org

run code in 300+ PHP versions simultaneously
<?php $m = ' <div>A</div> <di>B</div> <div>C</div> <div>A</div> <div>B</div> <div>C</div> <div>A</div> <div>B</div> <div>interference</div> <div>C</div> <div>A</div> <di>B</div> <div>C</div> <div>A</div> <div>B</div> <div>interference</div> <div>more interference</div> <div>C</div> '; //want to get the first, second and third //more like i want to get just the ones with no interference (capture the one with just 3 div) foreach (preg_split('/\n/', $m) as $line) { $pattern = '/<.*>(A)<.*> <.*>(B)<.*> <.*>(C)<.*>/'; var_dump( preg_replace($pattern, '$1$2 $3', $line)); }
Output for git.master, git.master_jit, rfc.property-hooks
string(0) "" string(4) "AB C" string(4) "AB C" string(0) "" string(4) "AB C" string(0) "" string(4) "AB C" string(0) "" string(4) "AB C" string(0) ""

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:
43.97 ms | 1995 KiB | 4 Q