In a DB table from wordpress (Caldera Form plugin), there’s a JSON array as value, and from a query, result has this structure :
Array (
[0] => stdClass Object (
[config] => a:22:{
s:2:"ID";
s:15:"CF605df92fa7a17";
s:13:"_last_updated";
s:31:"Sat, 27 Mar 2021 16:44:15 +0000";
s:10:"cf_version";
s:5:"1.9.4";
s:4:"name";
s:29:"Registration for Artists 2021";
s:10:"scroll_top";...}
)
[1] => stdClass Object (
[config] => a:22:{
s:2:"ID";
s:15:"CF605ba79300239";
s:13:"_last_updated";
s:31:"Sat, 27 Mar 2021 16:44:51 +0000";
s:10:"cf_version";
s:5:"1.9.4";
s:4:"name";
s:29:"Inscription des Artistes 2021";
s:10:"scroll_top";...}
)
How can i read "a:22" then "s:15" inside ?
I done a json_decode with [config] value but it return a empty value..
2
Answers
you put me on the track
Using this array dump you posted, what does this return?
Pass the same variable you dumped through
$array
. This might not work but worth a shot.For example, if I have this
$array
dumped data…And run the above
unserialize()
function in loop, this is the output…Response to your last comment, what does this output… ?