public function validateAlphabetic($value, $charCount = null)
    {
        if (is_array($charCount)) {
            $charCount = $charCount[0];
        }

        // check for character limitation
        if ($charCount !== null) {
            $pattern = '/^[a-zA-Z???????]{0,'.$charCount.'}$/';
        } else {
            $pattern = '/^[A-Za-z???????]+$/';
        }

        // validation and return
        return (bool) preg_match($pattern, $value);
    }
public function validateAlphabetic($value, $charCount = null)
    {
        if (is_array($charCount)) {
            $charCount = $charCount[0];
        }

        // check for character limitation
        if ($charCount !== null) {
            $pattern = '/^[a-zA-Z???????]{0,'.$charCount.'}$/';
        } else {
            $pattern = '/^[A-Za-z???????]+$/';
        }

        // validation and return
        return (bool) preg_match($pattern, $value);
    }
public function validateAlphabetic ( $ value , $ charCount = null ) { if ( is_array ( $ charCount ) ) { $ charCount = $ charCount [ 0 ] ; } // check for character limitation if ( $ charCount !== null ) { $ pattern = '/^[a-zA-Z???????]{0,' . $ charCount . '}$/' ; } else { $ pattern = '/^[A-Za-z???????]+$/' ; } // validation and return return ( bool ) preg_match ( $ pattern , $ value ) ; }
Validates if given value fulfill the requirement "alphabetic".

@param mixed $value     The value to validation
@param int   $charCount The character limitation (optional)

@author Benjamin Carl <opensource@clickalicious.de>

@return bool TRUE if fulfilled requirements, otherwise FALSE
Validates if given value fulfill the requirement alphabetic .