Answer the question
In order to leave comments, you need to log in
Json_decode. Error adding to database?
Problem adding to database.
There is a form that works on Ajax Json PHP. I use json_decode, an error occurs when adding to the database.
Initially it didn't work with adding text in double quotes, I solved the problem like this:
$value = str_replace("\"", "", $value);
$value = str_replace('\\', '/', $value);
$ value = preg_replace('#(\.|\?|!|\(|\)){3,}#', '\1', $value);
Now everything works fine, but when entering the "&" sign into the field an error occurs when adding to the database
Please help!
Answer the question
In order to leave comments, you need to log in
Initially did not work with adding text in double quotes
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question