As per the documentation, you need to specify true as the second argument if you want an associative array instead of an object from json_decode. This would be the code:

$result = json_decode($jsondata, true);

If you want integer keys instead of whatever the property names are:

$result = array_values(json_decode($jsondata, true));

However, with your current decode you just access it as an object:

print_r($obj->Result);
Answer from Stephen 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
The json_decode() function is used to decode or convert a JSON object to a PHP object.
๐ŸŒ
W3Docs
w3docs.com โ€บ php
How to JSON Decode a String into an Array with PHP
This is a short guideline that provides comprehensive information on how to decode a JSON string into an array with the help of PHP.
๐ŸŒ
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 // JSON string $someJSON = '[{"name":"Jonathan Suh","gender":"male"},{"name":"William Philbin","gender":"male"},{"name":"Allison McKinnery","gender":"female"}]'; // Convert JSON string to Array $someArray = json_decode($someJSON, true); print_r($someArray); // Dump all data of the Array echo $someArray[0]["name"]; // Access Array data // Convert JSON string to Object $someObject = json_decode($someJSON); print_r($someObject); // Dump all data of the Object echo $someObject[0]->name; // Access Object data ?>
๐ŸŒ
Tutorial Republic
tutorialrepublic.com โ€บ php-tutorial โ€บ php-json-parsing.php
How to Encode and Decode JSON Data in PHP - Tutorial Republic
JSON data structures are very similar to PHP arrays. PHP has built-in functions to encode and decode JSON data. These functions are json_encode() and json_decode(), respectively.
๐ŸŒ
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.
Find elsewhere
๐ŸŒ
Jobtensor
jobtensor.com โ€บ Tutorial โ€บ PHP โ€บ en โ€บ JSON
PHP JSON - json_encode(), json_decode() | jobtensor
<?php $countries = array("Mark" => "USA", "Raymond" => "UK", "Jeff" => "JPN", "Mike" => "DE"); echo json_encode($countries); The json_decode() function is used to decode a JSON object into a PHP associative array or object.
๐ŸŒ
Reintech
reintech.io โ€บ blog โ€บ php-json-encoding-decoding-web-services
PHP and JSON: Encoding, Decoding, and Web Services | Reintech media
April 28, 2023 - Always validate decoded JSON data before using it in your application: function parseUserData(string $json): ?array { try { $data = json_decode($json, true, 512, JSON_THROW_ON_ERROR); // Validate required fields $required = ['name', 'email', 'age']; foreach ($required as $field) { if (!isset($data[$field])) { throw new InvalidArgumentException("Missing required field: {$field}"); } } // Validate data types if (!is_string($data['name']) || strlen($data['name']) === 0) { throw new InvalidArgumentException("Invalid name"); } if (!filter_var($data['email'], FILTER_VALIDATE_EMAIL)) { throw new InvalidArgumentException("Invalid email format"); } if (!is_int($data['age']) || $data['age'] < 0) { throw new InvalidArgumentException("Invalid age"); } return $data; } catch (JsonException $e) { error_log("JSON parsing error: " .
๐ŸŒ
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 ...
๐ŸŒ
Netlify
json2php.netlify.app
JSON to PHP - json_decode online
We're sorry but JSON to PHP doesn't work properly without JavaScript enabled. Please enable it to continue
๐ŸŒ
ReqBin
reqbin.com โ€บ code โ€บ php โ€บ zg4d50d8 โ€บ php-json-decode-example
How do I decode JSON in PHP?
To decode a JSON string or file in PHP, you can use the json_decode($json, $assoc, $depth, $options) function. The first parameter specifies the string to be decoded. The second optional parameter sets whether the returned object should be converted ...
๐ŸŒ
Edureka Community
edureka.co โ€บ home โ€บ community โ€บ categories โ€บ web development โ€บ php โ€บ json decode to array
json decode to array | Edureka Community
June 2, 2022 - I want to decode a JSON string into an array but I am getting this error. Fatal error: Cannot use ... Result']); ?> Can someone help me fix this?
๐ŸŒ
Medium
medium.com โ€บ @jochelle.mendonca โ€บ demystifying-json-and-arrays-in-php-unraveling-the-complexity-c8a1c9d51896
Demystifying JSON and Arrays in PHP: Unraveling the Complexity | Medium
March 6, 2024 - Letโ€™s walk through the nuances of working with PHP arrays and JSON, showing how easily to encode and decode JSON data.