I'm having trouble to find the exact formula to split the string on space if the word is longer than 2 character.
$str = 'test 1 vitamin d3 test 2';
$str_parts = preg_split('#(?:\s+|(vitamin [cde]))#', $str, -1, PREG_SPLIT_NO_EMPTY|PREG_SPLIT_DELIM_CAPTURE);
var_export($str_parts);
An ideal output would be:
['test 1', 'vitamin d3', 'test 2']