Or you can try this:
function split_uc($str, $insert = ' ')
{
$uc = range('A', 'Z');
$spc = array(' ', "\r", "\n", "\t");
$new_str = $str{0};
for ($i = 1; $i < strlen($str); $i++) {
if (in_array($str{$i}, $uc) && !in_array($str{$i - 1}, $spc)) {
$new_str .= $insert;
}
$new_str .= $str{$i};
}
return $new_str;
}
$txt = 'AnyWord OtherThing SplitString';
echo split_uc($txt);