Is the filter_var
function with the parameter FILTER_SANITIZE_STRING
an acceptable means to sanitizing database inputs?
I'm using the following when receiving input from a form and wanted to see if this was considered an acceptable practice.
I know that ideally one should use a parameterized interface but I'm curious about alternatives, provided there are any acceptable alternatives, to that approach.
$this->fname = filter_var( $this->fname, FILTER_SANITIZE_STRING );