Skip to content

PHP Developer Suite · free · no sign-up

JSON to PHP Array

Convert JSON into a PHP array.

How it works Report a problem

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

Can I convert it back?
Yes. Use the PHP Array to JSON tool.