You can tell preg_split() to split at any point in the line followed by three digits using the lookahead statement .
$str = "101WE3P-1An Electrically-Small104TU5A-3,Signal-Interference Duplexers Gomez-GarciaRobertoTU5A-3-01"; $result = preg_split('/(?=\d{3})/', $str, -1, PREG_SPLIT_NO_EMPTY); var_export($result);
Gives the following array:
array ( 0 => '101WE3P-1An Electrically-Small', 1 => '104TU5A-3,Signal-Interference Duplexers Gomez-GarciaRobertoTU5A-3-01', )
The PREG_SPLIT_NO_EMPTY flag PREG_SPLIT_NO_EMPTY used because the beginning of the line is also the point where there are three digits, so there is an empty division. We could change the regular expression so that it does not break at the very beginning of the line, but that would make it more difficult to understand at first glance, while the flag is very clear.
source share