I have a mySQL table which has a field where I keep my arrays in it. So in the table field I have this:
a:2:{i:0;s:10:"XXX1";i:1;s:10:"XXX2";}
I am using this code snippet in PHP to get the field value.
$getCodes = mysql_query("SELECT * FROM foo WHERE bar='$barID'");
while($codeRow = mysql_fetch_array($getCodes))
{
$code = $codeRow['codes'];
}
When I echo the $code, it prints the full array. How can I print each element on a new line or how can I access specific elements?