I have serialize values in data base, i fetch them from database then when i do
<pre>
print_r($DataValues)
</pre>
it shows me value like this
[0] => stdClass Object
(
[categories] => a:1:{i:38;s:21:"Summer Market Session";}
)
[1] => stdClass Object
(
[categories] => a:1:{i:38;s:21:"Summer Market Session";}
)
[2] => stdClass Object
(
[categories] => a:2:{i:38;s:21:"Summer Market Session";i:39;s:21:"Autumn Market Session";}
)
i want to get only the value after unserializing it, i tried to unserialize but is show bolean false
& when i try to print the value after running for each value it shows me below mentioned error
Catchable fatal error: Object of class stdClass could not be converted to string
I dont know how i do this i was trying all unserialize tactics what i know & also i tried to store value in array by using foreach loop but i am fail..
Kindly help how can i get value of it after unserilize it…??
Well, somehow I still can’t see the problem. I’ve reconstructed the data structure you seem to get from DB with this:
It gave me the same output you’d quoted in your question, so I guess that’s a correct reconstruction. To unwrap this data back, simple loop sufficed:
Or am I doing something wrong?
Anyway, here’s a sandbox to check all this.