Back to Tools

JSON to PHP Array

JSON to PHP Array

Convert JSON strings into PHP array syntax (associative or indexed)

PHP Tool
Source JSON
PHP Array Output

                

About the JSON to PHP Array

Convert JSON into a PHP array.

How to use the JSON to PHP Array

  1. Paste your code into the input box, or click Load Sample to load an example.
  2. Press Convert to PHP Array.
  3. Use Copy (or Download where shown) to keep the result. Clear empties the box.

Worked example

{"status":"success","data":[1,2,3]} becomes ['status' => 'success', 'data' => [1, 2, 3]].

Tips

  • Objects become associative arrays and lists become indexed arrays.

Frequently Asked Questions

Yes. Use the PHP Array to JSON tool.
Live Support
We usually reply within minutes

Enter your name to start a conversation with our team.