The essence of the problem, comes from js json string "poll": {"create": true, "question": "test1", "options": ["test2", "test3"]}

In php you get this line - $ options = urldecode (json_encode ($ project ['poll'] ['options']));

It seems to be all good, but I need to get rid of all the html tags in options, I do htmlspecialchars ($ options)

I wrap htmlspecialchars the resulting options string

In the end result - when the string is entered into the database, it is obtained of this type ["test2","test2"]

How do I properly wrap the input to ['poll'] ['option']

So that I can add a line to the database, not ["test2","test2"] , but ["test2","test2"]

  • So do strip_tags and not htmlspecialchars before saving to the database. htmlspecialchars usually use when outputting - jekaby
  • @jekaby Thank you dude - DimaRRR

0