public static function isNumeric($str)
    {
        if (!is_string($str)) {
            throw new \ErrorException('Accept string ' . gettype($str) . ' given');
        }

        return  (bool) preg_match('/^[0-9]+(\.[0-9]+)?$/', $str);
    }
public static function isNumeric($str)
    {
        if (!is_string($str)) {
            throw new \ErrorException('Accept string ' . gettype($str) . ' given');
        }

        return  (bool) preg_match('/^[0-9]+(\.[0-9]+)?$/', $str);
    }
public static function isNumeric ( $ str ) { if ( ! is_string ( $ str ) ) { throw new \ ErrorException ( 'Accept string ' . gettype ( $ str ) . ' given' ) ; } return ( bool ) preg_match ( '/^[0-9]+(\.[0-9]+)?$/' , $ str ) ; }
Check if the string is in numeric

@param string $str
@return bool

@throws \ErrorException
Check if the string is in numeric