With an sql query I'm grabbing the meta_value of a specific row from my wpdb. In sql it's an array, but it outputs in php as a string, like this:
a:1:{i:0;a:2:{i:0;s:10:”02/17/2014″;i:1;s:10:”Thom Stark”;}}
How can I convert this into a php array, so I can access the values from array 2's indices? My query looks like this:
$tabledata = $wpdb->get_row("SELECT meta_value FROM ".$prefix."frm_item_metas WHERE field_id='$fid' AND item_id='$eid'");
$data = $tabledata->meta_value;
echo $data;
outputs: a:1:{i:0;a:2:{i:0;s:10:”02/17/2014″;i:1;s:10:”Thom Stark”;}}
You can use unserialize
Its a serialized array so u need to use unserialize to convert it back to array as
NOTE : you have
”
it should be"