nerdexam
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)
  • A
    81% (46)
  • B
    5% (3)
  • C
    2% (1)
  • D
    12% (7)

Topics

#json_encode#JSON#data serialization

Community Discussion

No community discussion yet for this question.

Full 200-710 Practice