Tuesday, December 22, 2009

What's the output of the ucwords function in this example?

$formatted = ucwords("TECHINTERVIEWS IS COLLECTION OF INTERVIEW
QUESTIONS");
print $formatted;

What will be printed is TECHINTERVIEWS IS COLLECTION OF INTERVIEW
QUESTIONS.
ucwords() makes every first letter of every word capital, but it does not lower-case
anything else. To avoid this, and get a properly formatted string, it’s worth using
strtolower() first.

No comments:

Post a Comment

I just got my #domain @BigRock. Get upto 25% off with my personalized coupon link Get upto 25% off