What I am doing is posting an application form (many fields) to the database. After the data is posted, I try to serialize all fields to insert into the database. But I have an serialized data entry that lost many part of data, like this:
a:61:{s:12:"name_chinese";s:10:"李志
I think there may be some destructive inputs in the "name_chinese" field, but it is quite tricky that I can't re-generate the same error again to find the cause. Could someone tell me what cause this problem, and is there any helpful filter on each input before serialized that can prevent such problem?
json_encode()
, instead ofserialize