Basic PHP Programming Question:

Download Job Interview Questions and Answers PDF

What is the output of the ucwords function in this example?

PHP Interview Question
PHP Interview Question

Answer:

$formatted = ucwords("GLOBALGUIDELINE IS COLLECTION OF INTERVIEW QUESTIONS");
print $formatted;
What will be printed is GLOBALGUIDELINE 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.

Download PHP Interview Questions And Answers PDF

Previous QuestionNext Question
I am writing an application in PHP that outputs a printable version of driving directions. It contains some long sentences, and I am a neat freak, and would like to make sure that no line exceeds 50 characters. How do I accomplish that with PHP?What Is the difference between htmlentities() and htmlspecialchars()?