I did serialize() on my form and saved the string, is there any function which can populate values back to the form from serialized string?
I did serialize() on my form and saved the string, is there any function
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Check out http://phpjs.org/functions/unserialize:571
I recommend instead of serializing data for communication with javascript, you use
JSON. PHP should havejson_encode()andjson_decode()to help with this, and javascript also has built inJSONhandling functions, which you may not even need. For example, if$.getJSONgets a valid JSON string from the server, it will be transformed into a javascript object automatically.EDIT: assuming you are talking about jQuery’s
$.serialize(), that I know of there’s no function to undo this (I’m not even sure why that would ever be necessary..) but this should work: