Yes, there will always be 'special cases'.
Just for the sake of efficiency I tried to optimize my code above to make it run even faster.
function getWord4($text, $pos) {
$pos = strpos( $text, ' ', $pos);
if ($pos === FALSE) $pos = strlen($text);
$out = preg_split("#[^\w-']#", substr($text, 0, $pos), -1, PREG_SPLIT_NO_EMPTY);
return array_pop($out);
}
preg_split does the job faster and also, strpos() is more efficient than my while() loop - (which, btw, had a bug when $pos was in the last word! - the while loop did not stop)
We all had fun at this post but what does the original poster thinks of all this?