Page 1 of 1

Help - Cleaning Input Data

Posted: Sun Mar 07, 2010 8:38 pm
by michaeru
Good day,

I would like to ask the most efficient way to clean (remove HTML tags, and other formatting) the input data.

Something to add to:

stripslashes(strip_tags(htmlentities($_POST['val'])))

-Michaeru

Re: Help - Cleaning Input Data

Posted: Sun Mar 07, 2010 9:53 pm
by flying_circus
Regular Expressions are probably your best bet.

For most projects I dont strip tags. Use htmlentities() when you display the text and it should render exactly what was typed.