Skip to content
PHP Ecosystem
Explore

StringHelper

API reference › yii › helpers › StringHelper

classyii\helpers\StringHelper
ExtendsBaseStringHelper
Since2.0
Sourceframework/helpers/StringHelper.php

StringHelper.

MethodDescriptionDefined by
base64UrlDecode() staticDecodes “Base 64 Encoding with URL and Filename Safe Alphabet” (RFC 4648).BaseStringHelper
base64UrlEncode() staticEncodes string into “Base 64 Encoding with URL and Filename Safe Alphabet” (RFC 4648).BaseStringHelper
basename() staticReturns the trailing name component of a path.BaseStringHelper
byteLength() staticReturns the number of bytes in the given string.BaseStringHelper
byteSubstr() staticReturns the portion of string specified by the start and length parameters.BaseStringHelper
convertIniSizeToBytes() staticConverts php.ini style size to bytes.BaseStringHelper
countWords() staticCounts words in a string.BaseStringHelper
dirname() staticReturns parent directory’s path.BaseStringHelper
endsWith() staticCheck if given string ends with specified substring. Binary and multibyte safe.BaseStringHelper
explode() staticExplodes string into array, optionally trims values and skips empty ones.BaseStringHelper
findBetween() staticReturns the portion of the string that lies between the first occurrence of the start string and the last occurrence of the end string after that.BaseStringHelper
floatToString() staticSafely casts a float to string independent of the current locale.BaseStringHelper
mask() staticMasks a portion of a string with a repeated character.BaseStringHelper
matchWildcard() staticChecks if the passed string would match the given shell wildcard pattern.BaseStringHelper
mb_ucfirst() staticThis method provides a unicode-safe implementation of built-in PHP function ucfirst().BaseStringHelper
mb_ucwords() staticThis method provides a unicode-safe implementation of built-in PHP function ucwords().BaseStringHelper
normalizeNumber() staticReturns string representation of number value with replaced commas to dots, if decimal point of current locale is comma.BaseStringHelper
startsWith() staticCheck if given string starts with specified substring. Binary and multibyte safe.BaseStringHelper
truncate() staticTruncates a string to the number of characters specified.BaseStringHelper
truncateWords() staticTruncates a string to the number of words specified.BaseStringHelper
truncateHtml() protected staticTruncate a string while preserving the HTML.BaseStringHelper