what is preg_match and how can i use it to validate the input field.
in preg_match you can define any pattern for matching the user input.
And then use the preg_match method find the number of matches in it.
<? $pattern = "";// Write regular expression here $string = ""; //Variable to hold user input //use preg_match to find no of matched $count = preg_match($pattern, $string); print $count; //based on the count value you can validate the input ?>