php unserialize返回空的解决办法

 php unserialize返回空的解决办法

 
UTF8
$need_info= preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $need_info);
$need_info= str_replace("\r", "", $need_info);
 
GBK
$need_info = preg_replace('!s:(\d+):"(.*?)";!se', '"s:".strlen("$2").":\"$2\";"', $need_info );
$need_info= str_replace("\r", "", $need_info);

你可能感兴趣的:(PHP,unserialize)