php自用常用函数

175 阅读1分钟

str_split(string $string, int $split_length = 1): array; 将一个字符串转换为数组。例:$characters = str_split($this->codeSet)

preg_split(string $pattern,string $subject, int $limit = -1, int $flags = 0 ): array;通过一个正则表达式分隔给定字符串。例:$characters = preg_split('/(?<!^)(?!$)/u', $this->zhSet);

property_exists([mixed] $class, string $property): bool 检查对象或类是否具有该属性