Unserialize with javascript

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Unserialize with javascript

Post 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?
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Post 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?
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post 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....
Post Reply