I want to separate a string with a whitespaces based on the pattern I want. In every two words and sometimes three. For example:
$string = 'marketplace';
become
$string = 'mark et pl ace';
I know that preg_replace can do this but I don't know the pattern. Can anybody tell me how to do it? Thanks
$string = implode(' ', str_split($string, 2));