So, I commonly use serialize() and unserialize() to enter and extract arrays from my db. I've never had any problems entering the data, but just recently, strange results have been occuring when I try to unserialize the serialized array from the db. First off, here is the array in serialized form:
a:1:{i:1089154742;a:3:{i:0;s:6:"Blaser";i:1;s:14:"ImAWannabeOgre";i:2;s:410:"Our thieves assassinated 180 enemy wizards!
Our thieves have returned with 78,835gc.
Our thieves were able to steal 45,150 runes.
Our thieves were able to steal 35,685 runes.
Our thieves were able to steal 28,203 runes
Our thieves were able to steal 22,291 runes.
Our thieves were able to steal 17,618 runes.
Our thieves were able to steal 13,925 runes.
We have converted 553 enemy soldiers to our army.";}}
Now, here is the error I get:
Notice: unserialize(): Error at offset 489 of 499 bytes in c:\root\web\utopiapimp\array.php on line 14
all that happens on that line is
PHP:
echo htmlentities(print_r(unserialize($_POST['data']),T
rue));
where $_POST['data'] is the serialized array listed above.
Normally, I would understand the above error, but I can't see what error in the serialized text it's referring to. since no manipulation occurs on the text between entering and retrieving it from the database (other than addslashes() on entry to create a valid mysql statement).
I can't really figure out where the error in my code is, but I figured I might get a hint if I can figure out what error the Notice is referring to in the serialized text. In other words: I know what the error means in general terms, I just don't know what's at this specific byte that is making it complain.
Thanks in advance!