Answers for "how to sanitize user input data in php"

PHP
1

sanitize user input php

<?php
function sanitize($stringToSanitize) {
	return addslashes(htmlspecialchars($stringToSanitize));
}
// You can just use the codes themselves instead of creating a function as:
echo addslashes(htmlspecialchars($stringToSanitize));
?>
Posted by: Guest on December-02-2020

Browse Popular Code Answers by Language