這是我的字符串我想反序列化這個字符串。unseralize + php給出轉換原始值
$string3 = 'a:3:{i:0;a:2:{s:5:"value";d:4.0999999999999996;s:7:"players";a:2:{i:6;i:6;i:7;i:7;}}i:1;a:2:{s:5:"value";d:10.899999999999999;s:7:"players";a:1:{i:7;i:7;}}i:2;a:2:{s:5:"value";d:1.7763568394002505E-15;s:7:"players";N;}}';
和它給下面結果
Array
(
[0] => Array
(
[value] => 4.1 // this value converted to 4.1 original was see in the string it was 4.0999999999999996
[players] => Array
(
[6] => 6
[7] => 7
)
)
[1] => Array
(
[value] => 10.9 // this value converted to 10.9 original was see in the string it was 10.899999999999999
[players] => Array
(
[7] => 7
)
)
[2] => Array
(
[value] => 1.7763568394003E-15
[players] =>
)
)
其轉換爲4.1和10.9等欲原始值不轉換數組值。
好的......問題是什麼? – 2013-03-13 09:34:13
看到陣列上的評論 – 2013-03-13 09:35:03
反序列化http://php.net/manual/en/function.unserialize.php – 2013-03-13 09:37:10