The Brown Fox is too Close Suggestion: If this function is called many times, move the first five lines to the beginning of your php script and set $exceptions as a global. */ function Capitalize($title, $delimiter = " ") { /* Capitalizes the words in a title according to the MLA Handbook. $delimiter parameter is optional. It is only needed if delimiter is not a space. */ $articles = 'a|an|the'; $prepositions = 'aboard|above|according|across|against|along|around|as|at|because|before|below|beneath|beside|between|beyond|by|concerning|during|except|for|from|inside|into|like|near|next|of|off|on|out|outside|over|past|since|through|to|toward|underneath|until|upon|with'; $conjunctions = 'and|but|nor|or|so|yet'; $verbs = 'are|be|did|do|is|was|were|will'; $exceptions = explode('|',$articles.'|'.$prepositions.'|'.$conjunctions.'|'.$verbs); $words = explode($delimiter,$title); $lastWord = count($words)-1; // first & last words are always capitalized $words[0] = ucfirst($words[0]); $words[$lastWord] = ucfirst($words[$lastWord]); for($i=1; $i<$lastWord; $i++) { if (!in_array($words[$i],$exceptions)) { $words[$i] = ucfirst($words[$i]); } } $newTitle = implode(' ',$words); return $newTitle; } ?>