Zend
200-710 · Question #57
QUESTION 60 Given a PHP value, which sample shows how to convert the value to JSON?
The correct answer is A. $string = json_encode($value). See the full explanation below for the reasoning.
Data Formats & Types
Question
QUESTION 60
Given a PHP value, which sample shows how to convert the value to JSON?
Options
- A$string = json_encode($value);
- B$string = json::encode($value);
- C$json = new Json($value); $string = $json->__toString();
- D$value = (object) $value; $string = $value->__toJson();
How the community answered
(57 responses)- A81% (46)
- B5% (3)
- C2% (1)
- D12% (7)
Topics
#json_encode#JSON#data serialization
Community Discussion
No community discussion yet for this question.