Htmlspecialchars() is a function to convert special characters to HTML entities. Description $variable = htmlspecialchars($text); Some special characters have special meaning for browsers, so they should be converted to entities. This prevents genera…