How to get value from array? message: "Cannot use object of type stdClass as array" - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: How to get value from array? message: "Cannot use object of type stdClass as array" (/showthread.php?tid=71859) |
How to get value from array? message: "Cannot use object of type stdClass as array" - DELE - 10-02-2018 How to get value [id] from array [0]. Code: $a = ($details->production_companies); RE: How to get value from array? message: "Cannot use object of type stdClass as ... - kaitenz - 10-02-2018 That's easy. PHP Code: $details->production_companies[0]->id; RE: How to get value from array? message: "Cannot use object of type stdClass as ... - DELE - 10-02-2018 (10-02-2018, 02:50 AM)kaitenz Wrote: That's easy. before i use this code "$a[0]->id;" but message error. but after I tried again it turned out to be. Surprisingly. there might be an error when defining $a. hehe Thanks |