Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
I have a PHP script that uses CURL to return a JSON result that looks //Curl set up code $result = curl_exec($ch); //Error checking code $json = json_decode($result, true); //Code to process r...
#1: Initial revision
What are the pros and cons of using objects vs associative arrays for JSON results of a CURL request in PHP?
I have a PHP script that uses CURL to return a JSON result that looks ``` //Curl set up code $result = curl_exec($ch); //Error checking code $json = json_decode($result, true); //Code to process result. ``` Now with the `json_decode` function, I could set it to return process the JSON into a PHP object or to an associative array. What would the pros and cons of using objects vs associative arrays for the output of the `json_decode` function?