This verifies if a PHP variable string contains characters other than letters or numbers using the PHP function ereg. This PHP code snippet can be useful for form input where you only want users to input alpha numeric characters.
Many times we need to use code to do one thing with different input values. If put this code at each place where we need this funtionality files in our PHP project will grow up with more lines of code.