Exam 350-401 All QuestionsBrowse all questions from this exam
Question 848

DRAG DROP

-

Drag and drop the code snippets from the bottom onto the blanks in the PHP script to convert a PHP array into JSON format. Not all options are used.

    Correct Answer:

Discussion
Alondrix

My networking skills are incredibly enhanced with the research required to answer this question!

studying_1

Answer is correct. // first configure array $InputArray = array(......); // json_encode function... the format is json_encode(name of the array) $encodedJSON = json_encode($InputArray, JSON_PRETTY_PRINT); //Finally print Print ($encodedJSON)

IgorLVG

php in the encore!?

shefo1

correct answer from google bard <?php $inputArray = array( "Listed devices" => array( "Site" => "Backbone", "data" => array( "IP" => "192.168.1.2", "Hostname" => "SW Core01", "Status" => "Active" ) ) ); $encodedJSON = json_encode($inputArray, JSON_PRETTY_PRINT); print($encodedJSON); ?>

SeMo0o0o

given answer is correct

mmt1mmt1

Could someone confirm if this is correct?

studying_1

Yes, answer is correct