Zend
200-550 · Question #182
How many elements does the array $matches from the following code contain? $str = "The cat sat on the roof of their house."; $matches = preg_split("/(the)/i", $str, -1, PREG_SPLIT_DELIM_CAPTURE);
The correct answer is D. 7. See the full explanation below for the reasoning.
Question
How many elements does the array $matches from the following code contain? $str = "The cat sat on the roof of their house."; $matches = preg_split("/(the)/i", $str, -1, PREG_SPLIT_DELIM_CAPTURE);
Options
- A2
- B3
- C4
- D7
- E9
How the community answered
(55 responses)- A13% (7)
- B2% (1)
- C9% (5)
- D73% (40)
- E4% (2)
Community Discussion
No community discussion yet for this question.