I have solved this problem, and now have another! Capitalising first letters following a punctuation, ignoring white space but still retaining it. IDEAS??
Final Code for macdonald >> MacDonald is (Note very little Reg Exp):
$const_w = array("Mac","Mc","D'","D`", "-the-", "-by-", "-on-");
GLOBAL $const_w;
$final = "";
$string = "OLD MACDONALD MACDONALD. FROM MAC A FARM DE LA SOUL MC LEE-ON-THE-SOLENT FUNKY DEMMACARNOLD MCTAVISH BIG MAC MEAL APPLE MACINTOSH BURGERMC BROMACTHER D'ARCY D`ARTY" ;
$string = ucwords(strtolower($string)) ;
$arr = split(" ",trim(ucwords($string)));
for ($i=0;$i<count($arr);$i++)
{
for ($x=0;$x<count($const_w);$x++)
if (ereg($const_w[$x],$arr[$i]))
{
$temp = explode($const_w[$x], $arr[$i]) ;
$final = $temp[0].$const_w[$x].ucwords($temp[1]) ;
$string = str_replace($arr[$i], $final, $string) ;
break ;
}
}