- var_dump: documentation ( source)
- array_merge: documentation ( source)
- explode: documentation ( source)
<?php
$needle = array('THIS', 'test', 'hello', 'A', 'is');
$haystack = array('helloTHISisAblindtest');
foreach ($needle as $a) {
$target = [];
foreach ($haystack as $h) {
$target = array_merge($target, explode($a, $h));
}
$haystack = $target;
}
var_dump($haystack);