时间:2021-07-01 10:21:17 帮助过:14人阅读
$row = unserialize($row['data']);
$row = unserialize($row['data']);
$row = unserialize($row['data']);
你 print_r($row); 看看就知道了
??使用了序列化,?行一次反序列化即可,但你的??有??
直接使用unserialize?返回false。
$content = 'a:9:{s:4:"time";i:1405306402;s:4:"name";s:6:"新晨";s:5:"url";s:1:"-";s:4:"word";s:1:"-";s:5:"rpage";s:29:"http://www.baidu.com/test.html";s:5:"cpage";s:1:"-";s:2:"ip";s:15:"117.151.180.150";s:7:"ip_city";s:31:"中国北京市 北京市移动";s:4:"miao";s:1:"5";}';var_dump(unserialize($content)); // bool(false)
function mb_unserialize($serial_str) { $serial_str= preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $serial_str ); $serial_str= str_replace("\r", "", $serial_str); return unserialize($serial_str);}$content = mb_unserialize($content);//?取timeecho $content['time']; //1405306402
居然?有?分。