Bird
0
0

Which PHP function converts all letters in a string to uppercase?

easy📝 Conceptual Q11 of 15
PHP - String Functions
Which PHP function converts all letters in a string to uppercase?
$text = "hello world";
Astrtoupper()
Bstrtolower()
Cucfirst()
Ducwords()
Step-by-Step Solution
Solution:
  1. Step 1: Understand the function purpose

    strtoupper() converts all characters in a string to uppercase letters.
  2. Step 2: Compare with other functions

    strtolower() makes all letters lowercase, ucfirst() capitalizes only the first letter, and ucwords() capitalizes the first letter of each word.
  3. Final Answer:

    strtoupper() -> Option A
  4. Quick Check:

    Uppercase function = strtoupper() [OK]
Quick Trick: All uppercase letters? Use strtoupper() [OK]
Common Mistakes:
  • Confusing strtoupper() with strtolower()
  • Using ucfirst() to uppercase whole string
  • Using ucwords() for full uppercase

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes