json_decode works for me on your data:

print_r(json_decode('{
       "data": [
          {
             "name": "Joe Bloggs",
             "id": "203403465"
          },
          {
             "name": "Fred Bloggs",
             "id": "254706567"
          },
          {
             "name": "Barny Rubble",
             "id": "453363843"
          },
          {
             "name": "Homer Simpson",
             "id": "263508546"
          }
       ]
    }
', true));

Output:

Array
(
    [data] => Array
        (
            [0] => Array
                (
                    [name] => Joe Bloggs
                    [id] => 203403465
                )

            [1] => Array
                (
                    [name] => Fred Bloggs
                    [id] => 254706567
                )

            [2] => Array
                (
                    [name] => Barny Rubble
                    [id] => 453363843
                )

            [3] => Array
                (
                    [name] => Homer Simpson
                    [id] => 263508546
                )

        )

)

Setting the second argument to true returns an associative array.

Answer from webbiedave 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 › func_json_decode.asp
PHP json_decode() Function
Store JSON data in a PHP variable, and then decode it into a PHP associative array: $jsonobj = '{"Peter":35,"Ben":37,"Joe":43}'; var_dump(json_decode($jsonobj, true)); Run Example » · How to access the values from the PHP object: $jsonobj ...
Discussions

JSON to PHP Associative array - Stack Overflow
would any of you know a good way to put this into an associative array . I have tried json_decode but found it to not be much help. This is the data i need to put into an associative array: { "... More on stackoverflow.com
🌐 stackoverflow.com
php - json_decode: object to associative array - Stack Overflow
How can I convert this horrible piece of code to an associative array? :D <... More on stackoverflow.com
🌐 stackoverflow.com
May 22, 2017
json - PHP json_decode to associative array - Stack Overflow
I have just been bashing my head against a brick wall for several hours trying to use the json_decode() function in PHP. The same problem has appeared on Stack Overflow many times, for example here... More on stackoverflow.com
🌐 stackoverflow.com
php - Use json_decode() to create array insead of an object - Stack Overflow
... unless you are json_decodeing millions of large arrays at once, in which case as @TCB13 points out, performance could be negatively effected. ... Just in case you are working on php less then 5.2 you can use this resourse. http://techblog.willshouse.com/2009/06/12/using-json_encode-and-json_decode-in-php4/ ... According to the PHP Documentation json_decode function has a parameter named assoc which convert the returned objects into associative ... More on stackoverflow.com
🌐 stackoverflow.com
August 16, 2016
People also ask

How do I convert JSON to an array in PHP?
Pass true as the second argument: json_decode('{"name":"Ada"}', true) returns ['name' =&gt; 'Ada'], so you read values with $data['name']. Without true, JSON objects become stdClass objects and you write $data-&gt;name.
🌐
coddy.tech
coddy.tech › docs › php › json_decode()
PHP json_decode(): Parse JSON into Arrays or Objects | Coddy
Why does json_decode return null?
The JSON is invalid (single quotes, a trailing comma, unquoted keys, a byte order mark), it is nested deeper than the depth limit, or the JSON really is null. Check jsonlasterrormsg(), or decode with JSONTHROWONERROR to get a JsonException with the reason.
🌐
coddy.tech
coddy.tech › docs › php › json_decode()
PHP json_decode(): Parse JSON into Arrays or Objects | Coddy
How do I read a JSON file in PHP?
Read the file, then decode it: $data = jsondecode(filegetcontents('data.json'), true, flags: JSONTHROWONERROR);. filegetcontents() returns false if the file is missing, so check that first.
🌐
coddy.tech
coddy.tech › docs › php › json_decode()
PHP json_decode(): Parse JSON into Arrays or Objects | Coddy
🌐
Fyicenter
dev.fyicenter.com › 1000572_json_decode()-JSON_Object_to_PHP_Associative_Array.html
json_decode() - JSON Object to PHP Associative Array
Actually, JSON Objects match better with PHP Associative Arrays than PHP Objects. You can force json_decode() function to turn return PHP Associative Arrays for any JSON Objects by giving the second argument as "true".
🌐
Tutorial Republic
tutorialrepublic.com › php-tutorial › php-json-parsing.php
How to Encode and Decode JSON Data in PHP - Tutorial Republic
... <?php // Assign JSON encoded string to a PHP variable $json = '{"Peter":65,"Harry":80,"John":78,"Clark":90}'; // Decode JSON data to PHP associative array $arr = json_decode($json, true); // Access values from the associative array echo ...
🌐
Jobtensor
jobtensor.com › Tutorial › PHP › en › JSON
PHP JSON - json_encode(), json_decode() | jobtensor
It has an optional second parameter that gives a PHP associative array instead of the default PHP object. <?php $countries_JSON = '{"Mark":"USA", "Raymond":"UK", "Jeff":"JPN", "Mike":"DE"}'; // using the default function var_dump(json_decode($countries_JSON)); // using the second parameter to give an associative array var_dump(json_decode($countries_JSON, true));
Find elsewhere
🌐
Coddy.Tech
coddy.tech › docs › php › json_decode()
PHP json_decode(): Parse JSON into Arrays or Objects | Coddy
3 weeks ago - json_decode($json, true) turns a JSON string into PHP values, with every JSON object as an associative array.
🌐
W3Resource
w3resource.com › php-exercises › file › php-file-handling-exercise-17.php
PHP JSON file: Read and convert to an associative array
April 20, 2026 - 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.
🌐
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 - When true is passed, JSON object will be converted into associative array; when false is passed, JSON object will be returned as stdClass object; when NULL is passed, it will return associative array or object depending on the JSON_OBJECT_AS_ARRAY ...
🌐
W3Schools
w3schools.com › php › php_json.asp
PHP and JSON
This example shows how to encode ... json_encode($cars); ?> Run Example » · The json_decode() function is used to decode a JSON object into a PHP object or an associative array....
🌐
Tek-Tips
tek-tips.com › home › forums › software › programmers › web development › php
How to parse associative array | Tek-Tips
November 9, 2023 - My code sample shows you that you can use both jason_decode(string) and then get an array of objecs, the objects within that array have to be adressed by $rowobj->fieldname and if you use json_decode(jsonstring,TRUE) you get an array of associative arrays and the elements of the associative ...
🌐
Stack Exchange
magento.stackexchange.com › questions › 318298 › how-to-convert-json-object-to-an-associative-array
php - How to convert Json object to an associative array? - Magento Stack Exchange
July 27, 2020 - Okay, If you doing pure PHP code then you can easily use $array = json_decode($jsonFormatdate, true); It's Working, I was things if you doing development in Magento that's why I have provided you Magento standard code.
🌐
GitHub
github.com › codeguy › php-the-right-way › issues › 479
Handling JSON and avoiding associative arrays. · Issue #479 · codeguy/php-the-right-way
December 3, 2014 - I'm saying it should be best practice to use the default value (false) for the second argument of json_decode to avoid leading PHP users astray. For example, if they start decoding to arrays (by setting the argument to true), they'd probably write a tonne of code relying on arrays and not realise until later that they can't differentiate between a JSON object and a JSON array.
🌐
Reintech
reintech.io › blog › php-json-encoding-decoding-web-services
PHP and JSON: Encoding, Decoding, and Web Services
April 28, 2023 - $json = '{"name":"John","age":30,"address":{"city":"New York","zip":"10001"}}'; // Decode to object $obj = json_decode($json); echo $obj->name; // John echo $obj->address->city; // New York // Decode to associative array $array = json_decode($json, true); echo $array['name']; // John echo ...
🌐
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
September 30, 2014 - ... 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.
🌐
Medium
medium.com › @prakash02cuet › associative-array-to-json-or-serialized-conversion-php-e19e1dc17c22
Associative array to JSON or Serialised conversion : PHP | by Prakash | Medium
June 13, 2024 - <?php $customer= [ "name"=>"Tommy Jason", "age" => 45, "sex" => "Male", "location" => "USA" ]; print_r($customer); echo "Serialized: <br>"; $serializedCustomer =serialize($customer); echo $serializedCustomer; echo "<br>"; echo "Unserialized: <br>"; $unserializedCustomer =unserialize($serializedCustomer); print_r($unserializedCustomer); echo "<br>"; echo "JSon Encoded<br>"; echo $jsonEncoded = json_encode($customer); echo "<br>"; echo "Json Decoded --converted to object <br>"; $jsonDecoded= json_decode($jsonEncoded); print_r($jsonDecoded); echo "<br>Json Decoded --converted to Array <br>"; $jsonDecoded= json_decode($jsonEncoded,true); print_r($jsonDecoded); echo "<br>"; ?>