PHP - String FunctionsHow can you convert a string to uppercase but keep the first letter lowercase in PHP?A$result = lcfirst(strtoupper($input));B$result = ucfirst(strtolower($input));C$result = strtolower(ucfirst($input));D$result = strtoupper(lcfirst($input));Check Answer
Step-by-Step SolutionSolution:Step 1: Understand the requirementConvert all letters to uppercase except the first letter which should be lowercase.Step 2: Analyze function combinationstrtoupper($input) makes all uppercase, then lcfirst() converts first letter to lowercase, achieving the goal.Final Answer:$result = lcfirst(strtoupper($input)); -> Option AQuick Check:Uppercase with first letter lowercase = $result = lcfirst(strtoupper($input)); [OK]Quick Trick: Use strtoupper() then lcfirst() to lowercase first letter [OK]Common Mistakes:Using ucfirst() instead of lcfirst()Applying strtolower() incorrectlyReversing function order
Master "String Functions" in PHP9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More PHP Quizzes Classes and Objects - Properties and visibility - Quiz 11easy Error and Exception Handling - Custom exception classes - Quiz 3easy File Handling - File existence and info checks - Quiz 11easy Interfaces and Traits - Interface vs abstract class vs trait - Quiz 8hard Sessions and Cookies - How sessions work in PHP - Quiz 8hard String Functions - Implode and join - Quiz 3easy String Functions - Substring extraction - Quiz 15hard String Functions - String replace functions - Quiz 13medium String Functions - Trim functions - Quiz 15hard Superglobals and Web Context - Form handling execution flow - Quiz 14medium