Basic PHP Programming Question:
Download Job Interview Questions and Answers PDF
What is the output of the ucwords function in this example?
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.
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