Class yii\helpers\StringHelper

Inheritanceyii\helpers\StringHelper » yii\helpers\BaseStringHelper
Available since version2.0
Source Code https://github.com/yiisoft/yii2/blob/master/framework/helpers/StringHelper.php

StringHelper.

Public Methods

Hide inherited methods

MethodDescriptionDefined 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. Binary and multibyte safe. 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. Binary and multibyte safe. 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

MethodDescriptionDefined By
truncateHtml() Truncate a string while preserving the HTML. yii\helpers\BaseStringHelper