- var_dump: documentation ( source)
- array_merge: documentation ( source)
- explode: documentation ( source)
- str_split: documentation ( source)
<?php
$txt = "lookSTARTfromhereSTARTagainhere";
$arr = explode("START", $txt); // Explode on START
unset($arr[0]); // first item is before START, we don't need that.
$res = [];
foreach($arr as $val){
$temp = str_split($val, 4); // Split array item on four letters.
$res = array_merge($res, $temp); // merge the new array with result array
}
var_dump($res);