PrepAway - Latest Free Exam Questions & Answers

which sample shows how to convert the value to JSON?

Given a PHP value, which sample shows how to convert the value to JSON?

PrepAway - Latest Free Exam Questions & Answers

A.
$value = (object) $value; $string = $value->__toJson();

B.
$string = json_encode($value);

C.
$string = Json::encode($value);

D.
$json = new Json($value); $string = $json->__toString();


Leave a Reply

Your email address will not be published. Required fields are marked *