What does explode(",", "red,green,blue") return?
-
A
An array of three strings
Correct answer
-
B
A boolean true value
-
C
A single joined string
-
D
The number 3
Correct answer
A. An array of three strings
15 views
Explanation
explode() splits a string by a delimiter into an array: ['red', 'green', 'blue']. implode() does the reverse, joining array elements into one string.
Reference
Asked in: NTS, PPSC, PHP Developer Interviews
Doubts & discussion
Not sure why the answer is A? Ask here and get an explanation.
Ask a doubt about this MCQ