I'm using the Serialize function to store an array in my MYSQL database, and then I'm unSerialize Him in other page. The array structure look like this :
Array ( [0] => Array ( [names] => somename1 [rating] => 10 ) [1] => Array ( [names] => somename2 [rating] => 9 ) )
When I INSERT the array to the database I'm using this function to convert it to string :
$array_string=mysql_escape_string(serialize($arr));
And then, when I'm doing the unSerialize, I don't know how to restore the string(array in the database) to the exactly structure that it was before. (how to convers this string back to array)
I know I have to use this line :
$arr=explode("|",$list);
In some way, but I can't restore it to the exactly structure of the array it was before. The result of this line is a little bit different in the structure of the array :
Array ( [0] => Array( [0] => Array ( [names] => d [rating] => 7 ) [1] => Array ( [names] => b [rating] => 6 ) ) )
Thanks