-3

Good day, this code is wrong:

filter_var_array(['<b> text</b>  \`/ =)', ' " \ " '], FILTER_SANITIZE_FULL_SPECIAL_CHARS, FILTER_FLAG_NO_ENCODE_QUOTES);

Why the flag FILTER_FLAG_NO_ENCODE_QUOTES isn't working?

6
  • What's the error message? Commented Feb 13, 2016 at 14:56
  • “Why the flag FILTER_FLAG_NO_ENCODE_QUOTES isn't working?” – because you are passing it as the third parameter to the function, which has a totally different meaning. Commented Feb 13, 2016 at 14:59
  • Thanks! It's very interesting! Commented Feb 13, 2016 at 16:14
  • But what I must to do? Commented Feb 13, 2016 at 16:17
  • TIIUNDER there aren't any error messages Commented Feb 13, 2016 at 16:19

1 Answer 1

0

Because you have a comma, so your flag is given to filter_var_array as third argument.

try:

filter_var_array(['<b> text</b>  \`/ =)', ' " \ " '],
FILTER_SANITIZE_FULL_SPECIAL_CHARS ^ FILTER_FLAG_NO_ENCODE_QUOTES);

instead

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.