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
where $_POST['data'] is the serialized array listed above.PHP Code:echo htmlentities(print_r(unserialize($_POST['data']),True));
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.
Thanks in advance!


LinkBack URL
About LinkBacks



Reply With Quote
. The site I pulled this data from is one on which I recently published a large number of changes, so common sense would say 'something you changed is causing this'. I don't believe I touched any of the code that messes with these particular arrays, and so it's hard for me to pick a spot in my code without finding out what that error *really* means

Bookmarks