其他教程

其他教程

Products

当前位置:首页 > 其他教程 >

PHP中unserialize()函数报 Error at offset解决方法

GG网络技术分享 2025-03-18 16:17 1


Error at offset有可能是编码的问题可以自定义函数解决

function diy_unserialize($str){

$str=preg_replace_callback(\'#s:(\\d+):\"(.*?)\";#s\',function($match){return \'s:\'.strlen($match[2]).\':\"\'.$match[2].\'\";\';},$str);

return unserialize($str);

}

标签: 有可能 函数

提交需求或反馈

Demand feedback