350-401 · Question #1080
350-401 Question #1080: Real Exam Question with Answer & Explanation
The correct arrangement uses '$encodedJSON' as the variable to store the result, and 'json_encode' as the PHP function to convert a PHP array into JSON format. The script follows the pattern: '$encodedJSON = json_encode($inputArray);', where json_encode() is the built-in PHP func
Question
Drag and Drop Question 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. Answer:
Explanation
The correct arrangement uses '$encodedJSON' as the variable to store the result, and 'json_encode' as the PHP function to convert a PHP array into JSON format. The script follows the pattern: '$encodedJSON = json_encode($inputArray);', where json_encode() is the built-in PHP function specifically designed to serialize PHP values (arrays, objects) into a JSON-formatted string.
Topics
Community Discussion
No community discussion yet for this question.