I have the following data as an example:
$a = addslashes('hello\'s');
$b = serialize($a);
// As you know, $b looks like this s:8:"hello\'s";
Now when I insert $b to MySQL, the data now looks like this s:8:"hello's" inside MySQL. MySQL removes the \ and now I have an invalid serialized data.
What's the best way to fix this? Thanks