I have installed PHP 8.1 and I started testing my old project. I have used the filter FILTER_SANITIZE_STRING
like so:
$username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING);
Now I get this error:
Deprecated: Constant FILTER_SANITIZE_STRING is deprecated
The same happens when I use FILTER_SANITIZE_STRIPPED
:
Deprecated: Constant FILTER_SANITIZE_STRIPPED is deprecated
What can I replace it with?