Str
class Str
Methods
The MIT License (MIT)
The MIT License (MIT)
改行コードの変換
文字コードの判定
指定した文字列以上ある場合、「.
現在からの経過時間を書式化する.
変数が空白かどうかをチェックする.
No description
両端にある全角スペース、半角スペースを取り除く
Details
at line 61
static string
random(int $length = 16)
The MIT License (MIT)
Copyright (c)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
Generate a more truly "random" alpha-numeric string.
at line 106
static string
quickRandom(int $length = 16)
The MIT License (MIT)
Copyright (c)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
Generate a "random" alpha-numeric string.
Should not be considered sufficient for cryptography, etc.
at line 121
static string
convertLineFeed($value, string $lf = "\n")
改行コードの変換
at line 135
static string
characterEncoding($value, $encoding = array('UTF-8', 'SJIS', 'EUC-JP', 'ASCII', 'JIS', 'sjis-win'))
文字コードの判定
at line 156
static string
ellipsis(string $value, int $length = 100, string $end = '...')
指定した文字列以上ある場合、「.
..」を付加する lengthに7を指定すると、「1234567890」は「1234567...」と「...」を付与して出力される
at line 172
static string
timeAgo($date)
現在からの経過時間を書式化する.
at line 228
static boolean
isBlank(string $value, boolean $greedy = false)
変数が空白かどうかをチェックする.
引数 $value が空白かどうかをチェックする. 空白の場合は true. 以下の文字は空白と判断する. - ' ' (ASCII 32 (0x20)), 通常の空白 - "\t" (ASCII 9 (0x09)), タブ - "\n" (ASCII 10 (0x0A)), リターン - "\r" (ASCII 13 (0x0D)), 改行 - "\0" (ASCII 0 (0x00)), NULバイト - "\x0B" (ASCII 11 (0x0B)), 垂直タブ
引数 $value がオブジェクト型、配列の場合は非推奨とし、 EUSERDEPRECATED をスローする. EC-CUBE2系からの互換性、ビギナー層を配慮し、以下のような実装とする. 引数 $value が配列の場合は, 空の配列の場合 true を返す. 引数 $value が ArrayCollection::isEmpty() == true の場合 true を返す. 引数 $value が上記以外のオブジェクト型の場合は false を返す.
引数 $greedy が true の場合は, 全角スペース, ネストした空の配列も 空白と判断する.
at line 290
static bool
isNotBlank($value, $greedy = false)
at line 301
static string
trimAll($value)
両端にある全角スペース、半角スペースを取り除く