I have decoded a JSON file into a variable ($tmp). var_dump($tmp) gives:
object(stdClass)#31 (3) {
["c"]=> int(2)
["r"]=> int(2)
["d"]=> object(stdClass)#32 (4) {
["1"]=> string(2) "un"
["2"]=> string(4) "deux"
["3"]=> string(5) "trois"
["4"]=> string(6) "quatre"
}
}
I want to retrieve for example "un" so I do $tmp->d["1"] but it doesn't work. I've got the following error:
Fatal error: Cannot use object of type stdClass as array in File.php on line 17