What are the PHP functions used to sanitize input and output? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

What are the PHP functions used to sanitize input and output?

this question appeared in Bca semester exam,i don't know the proper answer..can u help me?!

8th Oct 2017, 7:15 PM
sinchana mn
sinchana mn - avatar
2 Answers
+ 4
Hmm depends on what for? There is htmlspecialchars and strip_tags for dealing with HTML, addslashes for dealing with quotes, mysqli_real_escape_string and pg_escape_literal and pg_escape_identifier for sanitizing database inputs, and of course preg_match and preg_replace for all sorts of stuff.
8th Oct 2017, 8:14 PM
Schindlabua
Schindlabua - avatar
+ 4
Filters are used to sanitize input and output. reference=> http://php.net/manual/en/filter.filters.sanitize.php
8th Oct 2017, 8:16 PM
Nomeh Uchenna Gabriel
Nomeh Uchenna Gabriel - avatar