How come unserialize isn’t restoring my array? See code below..
// prints a:1:{s:8:'txn_type';s:32:'recurring_payment_profile_cancel';} echo $item['response']; // prints nothing print_r(unserialize($item['response']));
I understand why the print_r($response) gives me nothing
** edit – I noticed this
Notice: unserialize() [function.unserialize]: Error at offset 6 of 2797 bytes in /home/reitinve/public_html/action/doc.php on line 13
What does that mean?
Is it possible
$item['response']contains some whitespace before or after it?Check
strlen($item['response'])gives you 61.Edit: It seems to work with whitespace at the end, but whitespace at the start will make it fail to unserialize.
Edit: that error message means either you have a LOT of whitespace (almost 2kb of it), or
$item['response']is being changed between theechoand theunserialize