Tag: web technology

Questions Related to web technology

  1. echo ucwords(strtolower($word)

  2. echo ucwords($word)

  3. echo ucfirst(strtolower($word)

  4. echo ucfirst($word)


Correct Option: A
Explanation:

To solve this question, the user needs to know PHP string functions and the concept of case conversion.

  • ucwords(): This function converts the first character of each word in a string to uppercase.
  • strtolower(): This function converts a string to lowercase.
  • ucfirst(): This function converts the first character of a string to uppercase.

Option A: echo ucwords(strtolower($word)) - This option converts the string to lowercase using strtolower() function and then converts the first character of each word in the string to uppercase using ucwords() function. This will return the string in title case.

Option B: echo ucwords($word) - This option converts the first character of each word in the string to uppercase using ucwords() function. This will not convert the string to lowercase and therefore will not return the string in title case.

Option C: echo ucfirst(strtolower($word)) - This option converts the string to lowercase using strtolower() function and then converts the first character of the string to uppercase using ucfirst() function. This will not convert the first character of each word in the string to uppercase and therefore will not return the string in title case.

Option D: echo ucfirst($word) - This option converts the first character of the string to uppercase using ucfirst() function. This will not convert the first character of each word in the string to uppercase and therefore will not return the string in title case.

Therefore, the correct option is:

The Answer is: A. echo ucwords(strtolower($word))

  1. are different how they handle failure

  2. both are same in every aspects

  3. is include() produced a Fatal Error while require results in a Warning

  4. none of above


Correct Option: A
  1. Form Validation

  2. RGB Colors

  3. Browser Detection

  4. RGB Value


Correct Option: B
  1. comma

  2. semicolon

  3. colon

  4. Bracket


Correct Option: B