3v4l.org

run code in 300+ PHP versions simultaneously
<?php $needle = array('THIS', 'test', 'hello', 'A', 'is'); $haystack = array('helloTHISisAblindtest'); foreach ($arr as $a) { $target = []; foreach ($haystack as $h) { $target = array_merge($target, explode($a, $h)); } $haystack = $target; } var_dump($haystack);

preferences:
38.54 ms | 402 KiB | 5 Q