This depends on how tight you want the validation to be.
The sintaxis is pretty straight fordward:
$var = function_that_cleans_any_input($_POST['input_name']);
Usually validating functions return false
if it is a bad input so if the field is required you can use a condition like:
if(!$var){
die("The input is not valid");
}
For security matters you should ALWAYS scape strings that come from the user before inserting them into the database, this you can do with mysql_real_scape_string which prevents an attack called mysql injection that is very common and very dangerous.
If you know the field you are validating has a specific format i suggest you validate against that, for instance mail or a url, there is a filter function that is pretty easy to use and can help you with that.
If the input is an int, piece of cake, use typecasting $validated = (int)$input;
and that will do it, but if it's a date you an you the native checkdate function from php.
As you can see there is always a function that can save the day, if you are having trouble validating something be sure to investigate it throughly and if you don't find it make your own validating functions.
Here is a link that might help:http://hungred.com/useful-information/php-form-validation-snippets/