Page 1 of 1

Unserialize with javascript

Posted: Tue Oct 30, 2007 3:48 am
by shiznatix
I have a serialized array stored in a database as a type BLOB and I am trying to pull this out via ajax and use javascript to unserialize it. The problem is that I can't seam to unserialize it at all. I found this method:
http://www.phpguru.org/static/PHP_Unserialize.html

But that is not working. If I alert(); what it is doing as it does it, all goes well for a second then it returns a null value and breaks everything. Does anyone know of one that is better that will actually work?

Posted: Tue Oct 30, 2007 9:27 am
by Zoxive
shiznatix wrote:I have a serialized array stored in a database as a type BLOB and I am trying to pull this out via ajax and use javascript to unserialize it.
Why not unserialze, and have it generate a Javascript friendly array when you are getting it out of the database?

Posted: Tue Oct 30, 2007 9:47 am
by CoderGoblin
Have you thought of using JSON ? I know it doesn't help if all the information is in the database so much but....