StringHelper
abstract class StringHelper
Class StringHelper
Methods
使用正则验证数据
No description
计算字符长度
No description
No description
No description
********************** 生成一定长度的随机字符串函数 **********************
No description
No description
Convert \n and \r\n and \r to
No description
No description
No description
No description
No description
No description
No description
No description
var_dump(str2array('34,56,678, 678, 89, '));
No description
No description
字符截断输出
Copied from CakePHP String utility file
No description
Translates a string with underscores into camel case (e.g. first_name -> firstName)
No description
Transform a CamelCase string to underscore_case string
驼峰式 <=> 下划线式
[format description]
格式化,用空格分隔各个词组
缩进格式化内容,去空白/注释
Details
at line 19
static boolean
regexVerify(string $value, string $rule)
使用正则验证数据
at line 49
static bool|int
strlen($str, string $encoding = 'UTF-8')
at line 61
static int|string
length([type] $str)
计算字符长度
at line 87
static int
absLen(string $str)
at line 114
static string
utf8SubStr(string $str, int $start = 0, int $end = null)
at line 156
static string
zhSubStr(string $str, int $start = 0, int $length, string $charset = 'utf-8', bool $suffix = true)
at line 193
static string
random($length, array $param = [])
********************** 生成一定长度的随机字符串函数 **********************
at line 216
static bool|string
genSalt(int $length = 32)
at line 225
static bool|string
genUid(int $length = 7)
at line 256
static string
nl2br(string $str)
Convert \n and \r\n and \r to
at line 265
static bool|string
strtolower($str)
at line 278
static bool|string
strtoupper($str)
at line 294
static bool|string
substr($str, $start, bool|false $length = false, string $encoding = 'utf-8')
at line 310
static bool|int
strpos($str, $find, int $offset = 0, string $encoding = 'UTF-8')
at line 323
static bool|int
strrpos($str, $find, int $offset = 0, string $encoding = 'utf-8')
at line 333
static string
ucfirst($str)
at line 342
static string
ucwords($str)
at line 353
static array
toArray(string $str, string $sep = ',')
at line 376
static array
str2array(string $str, string $sep = ',')
var_dump(str2array('34,56,678, 678, 89, '));
at line 392
static array
split2Array(string $path, string $separator = '.')
at line 406
static
truncate($str, $max_length, $suffix = '...')
at line 424
static string
truncate_two(string $str, int $start, null|int $length = null)
字符截断输出
at line 451
static bool|string
truncateString(string $text, int $length = 120, array $options = array())
Copied from CakePHP String utility file
at line 578
static
toCamel($str, $upperFirstChar = false)
at line 590
static mixed
toCamelCase($str, bool $upperFirstChar = false)
Translates a string with underscores into camel case (e.g. first_name -> firstName)
at line 603
static
toSnake($str, $sep = '_')
at line 614
static string
toSnakeCase(string $str, string $sep = '_')
Transform a CamelCase string to underscore_case string
at line 629
static mixed|string
nameChange([type] $str, bool $toCamelCase = true)
驼峰式 <=> 下划线式
at line 678
static string
format($str, array $replaceParams = [], array $pregParams = [])
[format description]
at line 702
static string
wordFormat(string $keyword)
格式化,用空格分隔各个词组
at line 721
static mixed
deleteStripSpace($fileName, int $type = 0)
缩进格式化内容,去空白/注释