Here are some hints..
For checking blank fields you can use "isset" function, for calculating how many strings being passed you can use "strlen", to check for certain type of input like numbers use "ereg" function...
to check for combination of these... well... use combined with operators...