Sunday 11 September 2016

PHP Function to Validate Alpha Characters

Validate alpha characters using php snippets. This function allows only alphabets either in small letters or in capital letters. Php regex that allows only alpha characters.

function validateAlpha($string) {
    return (bool)preg_match("/^([a-zA-Z])+$/i", $string);
}

No comments:

Post a Comment