I am sending some data from a view to controller in php. I am using json_encode while sending the data and using json_decode at the other hand. The whole thing is working fine but when I use some special character in the data like single quote or double quote it fails and no data is received. Is there any way to fix this issue? I have tried using serialize and unserialize with base64 encoding, it worked for me but it's quite slow even with just few records.
Note: The $data is a multidimensional array
base64_encode(serialize($data)) unserialize(base64_decode($data))