yii\helpers\StringHelper - Yii2 类参考手册

Class yii\helpers\StringHelper

Inheritanceyii\helpers\StringHelper » yii\helpers\BaseStringHelper
Available since version2.0

StringHelper.

Public Methods

隐藏继承的方法 Hide inherited methods

方法 Method简介 Description定义在 Defined By
base64UrlDecode() Decodes "Base 64 Encoding with URL and Filename Safe Alphabet" (RFC 4648). yii\helpers\BaseStringHelper
base64UrlEncode() Encodes string into "Base 64 Encoding with URL and Filename Safe Alphabet" (RFC 4648). yii\helpers\BaseStringHelper
basename() Returns the trailing name component of a path. yii\helpers\BaseStringHelper
byteLength() Returns the number of bytes in the given string. yii\helpers\BaseStringHelper
byteSubstr() Returns the portion of string specified by the start and length parameters. yii\helpers\BaseStringHelper
countWords() Counts words in a string. yii\helpers\BaseStringHelper
dirname() Returns parent directory's path. yii\helpers\BaseStringHelper
endsWith() Check if given string ends with specified substring. yii\helpers\BaseStringHelper
explode() Explodes string into array, optionally trims values and skips empty ones. yii\helpers\BaseStringHelper
floatToString() Safely casts a float to string independent of the current locale. yii\helpers\BaseStringHelper
matchWildcard() Checks if the passed string would match the given shell wildcard pattern. yii\helpers\BaseStringHelper
mb_ucfirst() This method provides a unicode-safe implementation of built-in PHP function ucfirst(). yii\helpers\BaseStringHelper
mb_ucwords() This method provides a unicode-safe implementation of built-in PHP function ucwords(). yii\helpers\BaseStringHelper
normalizeNumber() Returns string representation of number value with replaced commas to dots, if decimal point of current locale is comma. yii\helpers\BaseStringHelper
startsWith() Check if given string starts with specified substring. yii\helpers\BaseStringHelper
truncate() Truncates a string to the number of characters specified. yii\helpers\BaseStringHelper
truncateWords() Truncates a string to the number of words specified. yii\helpers\BaseStringHelper

Protected Methods

隐藏继承的方法 Hide inherited methods

方法 Method简介 Description定义在 Defined By
truncateHtml() Truncate a string while preserving the HTML. yii\helpers\BaseStringHelper