I have an array that look like :
Array ( [0] => Array ( [names] => somename [rating] => 10 ) [1...]=>...)
And I am saving him in the database by converting him to a string by this way :
$array_string=mysql_escape_string(serialize($list));
And then I'm pushing him into the database.
Then, I'm taking this array (string in the database) into my page, and I'm doing unserialize this way :
$list= unserialize($query_row['list']);
And then I convert this string into array this way :
$arr=explode("|", $list);
Now I have a problem, when I'm checking by var_dump($arr); its printing me :
array(1) { [0]=> string(422) "Array( [0] => Array ( [names] => e [rating] => 5 ) [1] => Array ( [names] => d [rating] => 4 ) [2] => Array ( [names] => c [rating] => 3 ) [3] => Array ( [names] => b [rating] => 2 ) [4] => Array ( [names] => a [rating] => 1 ))" }
I don't know how to convert the string inside the array (string(422)) into array. Anyone have an idea? Thanks.