判断是否为数字
@param $str
@return bool
970740
public static function isNumberStr($str)
    {
        return !is_resource($str) && !is_array($str) && !is_object($str) && (is_int($str) || is_numeric($str) || preg_match('/^\d*$/', $str));
    }
280211
public static function isAlpha($str)
    {
        if (!is_string($str)) {
            throw new \ErrorException('Accept string ' . gettype($str) . ' given');
        }

        return (bool) preg_match('/^[a-zA-Z]+$/', $str);
    }
1360796
public static function isalnumat($str, $pos)
    {
        if ($pos >= strlen($str))
            return false;

        return (QRinput::lookAnTable(ord($str[$pos])) >= 0);
    }
1286867
public static function xml(string $str) : bool
    {
        $initialSetting = libxml_use_internal_errors();
        libxml_use_internal_errors(true);
        $result = simplexml_load_string($str) !== false;
        libxml_use_internal_errors($initialSetting);

        return $result;
    }
1366252
private function evalString($str)
    {
        $a = false;

        if (class_exists('ParseError')) {
            try {
                $a = eval("return $str;");
            } catch (ParseError $e) {
            }
        } else {
            $a = @eval("return $str;");
        }

        return $a;
    }
529243
public function find($str) {
        while ($line = $this->recvLine()) {
            if (preg_match("/{$str}/", $line, $matches)) {
                return $matches[0];
            }
        }
        return false;
    }
381869
public static boolean isAllNum(String str)
    {
        if (str == null)
            return false;

        int i = 0;
        /** 判断开头是否是+-之类的符号 */
        if ("±+-＋－—".indexOf(str.charAt(0)) != -1)
            i++;
        /** 如果是全角的０１２３４５６７８９ 字符* */
        while (i < str.length() && "０１２３４５６７８９".indexOf(str.charAt(i)) != -1)
            i++;
        // Get middle delimiter such as .
        if (i > 0 && i < str.length())
        {
            char ch = str.charAt(i);
            if ("·∶:，,．.／/".indexOf(ch) != -1)
            {// 98．1％
                i++;
                while (i < str.length() && "０１２３４５６７８９".indexOf(str.charAt(i)) != -1)
                    i++;
            }
        }
        if (i >= str.length())
            return true;

        /** 如果是半角的0123456789字符* */
        while (i < str.length() && "0123456789".indexOf(str.charAt(i)) != -1)
            i++;
        // Get middle delimiter such as .
        if (i > 0 && i < str.length())
        {
            char ch = str.charAt(i);
            if (',' == ch || '.' == ch || '/' == ch  || ':' == ch || "∶·，．／".indexOf(ch) != -1)
            {// 98．1％
                i++;
                while (i < str.length() && "0123456789".indexOf(str.charAt(i)) != -1)
                    i++;
            }
        }

        if (i < str.length())
        {
            if ("百千万亿佰仟%％‰".indexOf(str.charAt(i)) != -1)
                i++;
        }
        if (i >= str.length())
            return true;

        return false;
    }
1269524
public static function is_utf8($str) {
		if (\is_numeric($str) || \is_bool($str)) {
			return true;
		}
		elseif (\is_string($str)) {
			return (bool) \preg_match('//u', $str);
		}

		return false;
	}
369868
public function parse($str)
    {
        $this->removeBom($str);

        $data = $this->createM3uData();
        $lines = \explode("\n", $str);

        for ($i = 0, $l = \count($lines); $i < $l; ++$i) {
            $lineStr = \trim($lines[$i]);
            if ('' === $lineStr || $this->isComment($lineStr)) {
                continue;
            }

            if ($this->isExtM3u($lineStr)) {
                $tmp = \trim(\substr($lineStr, 7));
                if ($tmp) {
                    $data->initAttributes($tmp);
                }
                continue;
            }

            $data->append($this->parseLine($i, $lines));
        }

        return $data;
    }
1083420
private static function dealStr($str){
		$res = explode(self::$separate,$str);//空格分隔
        $str_time = preg_replace(self::$timeRegx,'',$res[self::$timeLine-1]);
        $date_time = \DateTime::createFromFormat(self::$timeFromat,$str_time,(new \DateTimeZone('Asia/Shanghai')));
        if ($date_time){
            $timestamp  = $date_time->getTimestamp();
        }else{
            throw new Exception("时间格式化有问题");
        }
        $t = $timestamp;
		$flow = $res[self::$flowLine-1]??0;//流量
		self::compareTime($t,$flow);
	}
1205765
public static function absLength($str) {
		if (empty($str)) {
			return 0;
		}
		if (function_exists('mb_strlen')) {
			return mb_strlen($str,'utf-8');
		}
        preg_match_all("/./u", $str, $ar);
        return count($ar[0]);
	}
380468
public static function isTagged(string $str): bool
    {
        return isset($str[1]) && strpos($str, '@') === 0 && ctype_alpha($str[1]);
    }
269161
static function stringContainsWord($str, array $arr)
    {
        foreach($arr as $a) {
            if (stripos($str,$a) !== false) return true;
        }
        return false;
    }
486979
public static function emails(string $str) {
		preg_match_all(self::REGEXP_EMAIL, $str, $matches);
		return $matches[0] ?? false;
	}
1319833
public static function isAlphaNum($str)
    {
        if (!is_string($str)) {
            throw new \ErrorException('Accept string ' . gettype($str) . ' given');
        }

        return (bool) preg_match('/^[a-zA-Z0-9]+$/', $str);
    }
444480
public function unshorten($str) {
		$num = 0;
		$len = strlen($str);

		for ($i = 0; $i < $len; $i++) {
			$num = $num * $this->base + strpos($this->alphabet, $str[$i]);
		}

		return $num;
	}
1317951
protected function isRegex($str)
    {
        if (preg_match('/^(.{3,}?)[imsxuADU]*$/', $str, $m)) {
            $start = substr($m[1], 0, 1);
            $end = substr($m[1], -1);

            if ($start === $end) {
                return !preg_match('/[*?[:alnum:] \\\\]/', $start);
            }

            foreach ([['{', '}'], ['(', ')'], ['[', ']'], ['<', '>']] as $delimiters) {
                if ($start === $delimiters[0] && $end === $delimiters[1]) {
                    return true;
                }
            }
        }

        return false;
    }