Forum Moderators: coopster
echo ucwords(strtolower(htmlentities($city)));
However in some cases it does not produce the result I expect. For instance, if the field is "LOS ANGELES/WEST HOLLYWOOD" the output is:
Los Angeles/west Hollywood
How can I format it so it gives me:
Los Angeles/West Hollywood
Thank you.
Not sure of your question
but to cap each word use
ucwords() [us2.php.net]
EDIT
you also may first make sure that you start with all lowercase() [us.php.net]then apply the second rule
/EDIT
$subject = 'LOS ANGELES/WEST HOLLYWOOD';
$subject = preg_replace("/\b([a-z])/e", "strtoupper('$1')", strtolower($subject));
print $subject;