If you pass the JSON in your post to json_decode, it will fail. Valid JSON strings have quoted keys:

json_decode('{foo:"bar"}');         // this fails
json_decode('{"foo":"bar"}', true); // returns array("foo" => "bar")
json_decode('{"foo":"bar"}');       // returns an object, not an array.
Answer from RickN on Stack Overflow
🌐
PHP
php.net β€Ί manual β€Ί en β€Ί function.json-decode.php
PHP: json_decode - Manual
JSON can be decoded to PHP arrays by using the $associative = true option. Be wary that associative arrays in PHP can be a "list" or "object" when converted to/from JSON, depending on the keys (of absence of them).
🌐
W3Schools
w3schools.com β€Ί php β€Ί php_json.asp
PHP and JSON
The json_decode() function is used to decode a JSON object into a PHP object or an associative array.
🌐
ReqBin
reqbin.com β€Ί code β€Ί php β€Ί 0uwqq41y β€Ί json-to-array-php-example
How do I convert JSON to PHP array?
To convert a JSON data string to a PHP array, you can use the json_decode($json) function. The json_decode() function accepts the JSON string as the first parameter and a few additional parameters to control the process of converting JSON to ...
🌐
Code Beautify
codebeautify.org β€Ί json-to-php-array-converter
JSON to PHP Array Converter to convert JSON to PHP Array Variable
JSON to PHP Array Converter is easy to use tool to convert JSON to PHP Array Variable. Copy, Paste and Convert.
🌐
Jsontophp
jsontophp.com
Convert JSON Object to PHP Array Online
JSON to PHP array converter online - Convert the given JSON object or Array into beautified PHP array that can be used instantly into your PHP file as a PHP array
🌐
Jonathan Suh
jonsuh.com β€Ί blog β€Ί convert-loop-through-json-php-javascript-arrays-objects
Convert and Loop through JSON with PHP and JavaScript Arrays/Objects β€” Jonathan Suh
PHP >= 5.2.0 features a function, json_decode, that decodes a JSON string into a PHP variable. By default it returns an object. The second parameter accepts a boolean that when set as true, tells it to return the objects as associative arrays.
🌐
Wtools
wtools.io β€Ί convert-json-to-php-array
Convert JSON to PHP Array Online | WTOOLS
Free tool for online converting JSON into appropriate PHP type as Array.
Find elsewhere
🌐
PHPpot
phppot.com β€Ί php β€Ί json-to-array-php
Convert JSON to Array in PHP with Online Demo - PHPpot
This native PHP function decodes the JSON string into a parsable object tree or an array. This is the syntax of this function. json_decode( string $json, ?bool $associative = null, int $depth = 512, int $flags = 0 ): mixed ...
🌐
ProxyScrape
proxyscrape.com β€Ί tools β€Ί php-to-json
PHP Array to JSON Converter - ProxyScrape Tools
Free online tool to convert PHP arrays to JSON format. Convert PHP array syntax to valid JSON objects and arrays with proper formatting. Perfect for PHP developers working with APIs.
🌐
PHP: json_decode()
parthpatel.net β€Ί home β€Ί php β€Ί php: json_decode() | how to decode json to array in php
PHP: json_decode() | How to decode json to array in PHP | Parth Patel - a Web Developer
September 9, 2021 - <?php // Store JSON data in a PHP variable $json = '{"email":"john@doe.com"}'; $obj = json_decode($json); print $obj->email; ?> ... Here's the simple explanation to how json_encode() works and how you can parse json to array or class objects in PHP.
🌐
PHPpot
phppot.com β€Ί php β€Ί php-object-to-array
PHP Object to Array Convert using JSON Decode - PHPpot
This quick example performs a PHP object to array conversion in a single step. It creates an object bundle and sets the properties. It uses JSON encode() decode() function for the conversion.
🌐
ReqBin
reqbin.com β€Ί code β€Ί php β€Ί 0kvtdskv β€Ί php-array-to-json-example
How do I convert PHP Array to JSON?
To convert a PHP array to JSON data string, you can use the json_encode($value, $flags, $depth) function. The json_encode() function takes a PHP array as input and returns a JSON string representation.
🌐
W3Resource
w3resource.com β€Ί php-exercises β€Ί file β€Ί php-file-handling-exercise-17.php
PHP JSON file: Read and convert to an associative array
We then use json_decode($jsonContents, true) to decode the JSON string into a PHP associative array. The second argument true specifies that we want an associative array rather than an object.
🌐
ConvertSimple
convertsimple.com β€Ί convert-json-to-php-array
Convert JSON to PHP Array Online - ConvertSimple.com
June 19, 2022 - Convert your JSON to a PHP array with this simple online JSON to PHP converter tool.
🌐
Quora
quora.com β€Ί How-do-I-make-a-JSON-array-in-PHP
How to make a JSON array in PHP - Quora
Answer: There are 2 ways you can craft a JSON array using PHP. I assume you want to pass the array back to the front end so it can process the data. 1: The hard way You can hand-code it. A json-encoded array is just a string. [code ]$myJsonArray = "{'name':'Cal Evans','occupation':'ElePHPant'}...