nerdexam
Cisco

350-401 · Question #1080

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:

The correct answer is $encodedJSON; json_encode. 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

Submitted by katya_ua· Mar 6, 2026Server-Side Scripting and Data Interchange - understanding how to use PHP built-in functions to encode and decode data in JSON format for web application development and API communication.

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:

Exhibit

350-401 question #1080 exhibit

Answer Area

Drag items

$encodedJSON$inputArray = arrayjson_encodejson_decode

Correct arrangement

  • $encodedJSON
  • json_encode

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

#PHP#JSON#Data Serialization#Web Development

Community Discussion

No community discussion yet for this question.

Full 350-401 Practice