- array_merge: documentation ( source)
- explode: documentation ( source)
<?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));
}
}