PHP - String FunctionsWhat will explode('-', '2024-06-15') return?A['2024', '06', '15']B['2024-06-15']C['2024', '-06', '-15']D['2024', '06-15']Check Answer
Step-by-Step SolutionSolution:Step 1: Identify the delimiter and stringThe delimiter is '-', so the string '2024-06-15' is split at each '-'.Step 2: Split the string by delimiterSplitting results in ['2024', '06', '15'] as each part between '-' is extracted.Final Answer:['2024', '06', '15'] -> Option AQuick Check:explode('-', string) splits at '-' correctly [OK]Quick Trick: Delimiter splits string into parts in explode() [OK]Common Mistakes:Expecting explode to keep delimitersWrong array parts due to delimiter confusionUsing wrong delimiter character
Master "String Functions" in PHP9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More PHP Quizzes Classes and Objects - Access modifiers (public, private, protected) - Quiz 3easy Error and Exception Handling - PHP error types and levels - Quiz 2easy Inheritance and Polymorphism - Constructor inheritance - Quiz 10easy Inheritance and Polymorphism - Final classes and methods - Quiz 10hard Interfaces and Traits - Trait conflict resolution - Quiz 2easy Interfaces and Traits - Interface vs abstract class vs trait - Quiz 9hard Interfaces and Traits - Multiple interface implementation - Quiz 4medium String Functions - String comparison functions - Quiz 4medium Superglobals and Web Context - $_GET for URL parameters - Quiz 7medium Superglobals and Web Context - $_GET for URL parameters - Quiz 13medium