public function detect($number)
    {
        foreach (self::$cardPatterns as $name => $pattern) {
            if (preg_match($pattern, $number)) {
                return $name;
            }
        }

        return false;
    }
public function detect($number)
    {
        foreach (self::$cardPatterns as $name => $pattern) {
            if (preg_match($pattern, $number)) {
                return $name;
            }
        }

        return false;
    }
public function detect ( $ number ) { foreach ( self :: $ cardPatterns as $ name => $ pattern ) { if ( preg_match ( $ pattern , $ number ) ) { return $ name ; } } return false ; }
Detect card brand from card number

@param string $number The card number to detect.
@return mixed|false Card name on success or false if not.
Detect card brand from card number