Timeline for How to convert an stdClass to an array?
Current License: CC BY-SA 4.0
23 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 26, 2024 at 18:35 | history | edited | nbro | CC BY-SA 4.0 |
added 2 characters in body; edited title
|
| Dec 14, 2021 at 9:26 | answer | added | incalite | timeline score: 3 | |
| Mar 20, 2020 at 22:10 | answer | added | nsdb | timeline score: 0 | |
| Sep 3, 2019 at 5:44 | answer | added | David Clews | timeline score: 67 | |
| Oct 4, 2018 at 13:03 | comment | added | Vincent Pazeller | In the general case, I think this is not possible. Consider if your objects have cycles, dereferencing this into arrays, will end up in an infinite loop... Just wanted to point this issue. For other scenarios, other answers are certainly valid... | |
| Jul 17, 2017 at 10:15 | answer | added | walter1957 | timeline score: -2 | |
| May 11, 2017 at 21:24 | answer | added | Nalantha | timeline score: 18 | |
| May 17, 2016 at 15:41 | answer | added | Loren | timeline score: 0 | |
| Dec 29, 2015 at 19:12 | comment | added | cnlevy | Shortening the question (like removing the custom function code) could be useful to see the accepted answer without having to scroll down | |
| Jan 8, 2015 at 16:04 | answer | added | Carlo Fontanos | timeline score: 19 | |
| Dec 27, 2013 at 14:48 | vote | accept | Alessandro Minoccheri | ||
| Dec 27, 2013 at 14:28 | answer | added | shasi kanth | timeline score: 4 | |
| Nov 21, 2013 at 7:50 | history | edited | Alessandro Minoccheri | CC BY-SA 3.0 |
edited title
|
| Nov 19, 2013 at 17:50 | answer | added | robzero | timeline score: 118 | |
| Nov 8, 2013 at 17:16 | history | edited | Alessandro Minoccheri | CC BY-SA 3.0 |
edited title
|
| Sep 2, 2013 at 15:54 | vote | accept | Alessandro Minoccheri | ||
| Dec 27, 2013 at 14:48 | |||||
| Sep 2, 2013 at 15:50 | answer | added | Vlad Preda | timeline score: 20 | |
| Sep 2, 2013 at 15:49 | answer | added | h2ooooooo | timeline score: 574 | |
| Sep 2, 2013 at 15:47 | comment | added | hakre |
You might be interested to read: How to get useful error messages in PHP? - Anyway, I was asking to var_dump() before casting. Do not re-use the same variable name btw. if $booking was something before casting, it should still be that something before casting and not something different afterwards. Differ between input and processing variables otherwise you run into problems that you don't understand any longer what you do there.
|
|
| Sep 2, 2013 at 15:44 | comment | added | Alessandro Minoccheri | after cast yes, and if i try to print this: $booking[0]['id'] return me that not exist | |
| Sep 2, 2013 at 15:44 | comment | added | hakre |
Just to clarify: var_dump($booking); outputs NULL?
|
|
| Sep 2, 2013 at 15:41 | comment | added | hakre |
php.net/var_dump ... php.net/var_export - before return. And running json_decode on an array seems pretty desperate to me, probably sitting too long in front of the computer and it's now time to take a break?
|
|
| Sep 2, 2013 at 15:38 | history | asked | Alessandro Minoccheri | CC BY-SA 3.0 |