Zend
200-550 · Question #217
Given a JSON-encoded string, which code sample correctly indicates how to decode the string to native PHP values?
The correct answer is C. $value = json_decode($jsonValue). See the full explanation below for the reasoning.
Question
Given a JSON-encoded string, which code sample correctly indicates how to decode the string to native PHP values?
Options
- A$json = new Json($jsonValue); $value = $json->decode();
- B$value = Json::decode($jsonValue);
- C$value = json_decode($jsonValue);
- D$value = Json::fromJson($jsonValue);
How the community answered
(45 responses)- A4% (2)
- B9% (4)
- C84% (38)
- D2% (1)
Community Discussion
No community discussion yet for this question.