为什么unserialize不能恢复我的阵列?见下面的代码..
// prints a:1:{s:8:"txn_type";s:32:"recurring_payment_profile_cancel";}
echo $item['response'];
// prints nothing
print_r(unserialize($item['response']));
Run Code Online (Sandbox Code Playgroud)
我明白为什么print_r($ response)什么都没给我
**编辑 - 我注意到了这一点
注意:unserialize()[function.unserialize]:第13行/home/reitinve/public_html/action/doc.php中偏移量为6的2797字节错误
那是什么意思?
是否可能$item['response']在其之前或之后包含一些空格?
检查strlen($item['response'])结果是 61。
编辑:它似乎可以在末尾使用空格,但是开头的空格将使其无法反序列化。
编辑:该错误消息意味着您有大量空白(几乎 2kb),或者$item['response']正在 和 之间进行echo更改unserialize