Zend
200-530 · Question #162
You want to extract the pieces of a date string, which looks like this: "2005-11-02". Which of the following pieces of code will properly assign $year, $month and $day with their respective values?
The correct answer is A. sscanf("2005-11-02", '%d-%d-%d', $year, $month, $day). See the full explanation below for the reasoning.
Question
You want to extract the pieces of a date string, which looks like this: "2005-11-02". Which of the following pieces of code will properly assign $year, $month and $day with their respective values?
Options
- Asscanf("2005-11-02", '%d-%d-%d', $year, $month, $day);
- Bscan("2005-11-02", '%d-%d-%d', $year, $month, $day);
- Csscanf('%d-%d-%d', "2005-11-02", $year, $month, $day);
- Dsscan($year, $month, $date '%d-%d-%d', "2005-11-02");
How the community answered
(17 responses)- A82% (14)
- B6% (1)
- D12% (2)
Community Discussion
No community discussion yet for this question.