Properties

$str

$str : string

An instance's string.

Type

string

$encoding

$encoding : string

The string's encoding, which should be one of the mbstring module's supported encodings.

Type

string

Methods

__construct()

__construct(mixed  $str = '', string  $encoding = null) : mixed

Initializes a Stringy object and assigns both str and encoding properties the supplied values. $str is cast to a string prior to assignment, and if $encoding is not specified, it defaults to mb_internal_encoding(). Throws an InvalidArgumentException if the first argument is an array or object without a __toString method.

Parameters

mixed $str

Value to modify, after being cast to string

string $encoding

The character encoding

Throws

\InvalidArgumentException

if an array or object without a __toString method is passed as the first argument

Returns

mixed —

create()

create(mixed  $str = '', string  $encoding = null) : static

Creates a Stringy object and assigns both str and encoding properties the supplied values. $str is cast to a string prior to assignment, and if $encoding is not specified, it defaults to mb_internal_encoding(). It then returns the initialized object. Throws an InvalidArgumentException if the first argument is an array or object without a __toString method.

Parameters

mixed $str

Value to modify, after being cast to string

string $encoding

The character encoding

Throws

\InvalidArgumentException

if an array or object without a __toString method is passed as the first argument

Returns

static —

A Stringy object

__toString()

__toString() : string

Returns the value in $str.

Returns

string —

The current value of the $str property

append()

append(string  $string) : static

Returns a new string with $string appended.

Parameters

string $string

The string to append

Returns

static —

Object with appended $string

at()

at(int  $index) : static

Returns the character at $index, with indexes starting at 0.

Parameters

int $index

Position of the character

Returns

static —

The character at $index

between()

between(string  $start, string  $end, int  $offset) : static

Returns the substring between $start and $end, if found, or an empty string. An optional offset may be supplied from which to begin the search for the start string.

Parameters

string $start

Delimiter marking the start of the substring

string $end

Delimiter marking the end of the substring

int $offset

Index from which to begin the search

Returns

static —

Object whose $str is a substring between $start and $end

camelize()

camelize() : static

Returns a camelCase version of the string. Trims surrounding spaces, capitalizes letters following digits, spaces, dashes and underscores, and removes spaces, dashes, as well as underscores.

Returns

static —

Object with $str in camelCase

chars()

chars() : array

Returns an array consisting of the characters in the string.

Returns

array —

An array of string chars

collapseWhitespace()

collapseWhitespace() : static

Trims the string and replaces consecutive whitespace characters with a single space. This includes tabs and newline characters, as well as multibyte whitespace such as the thin space and ideographic space.

Returns

static —

Object with a trimmed $str and condensed whitespace

contains()

contains(string  $needle, bool  $caseSensitive = true) : bool

Returns true if the string contains $needle, false otherwise. By default the comparison is case-sensitive, but can be made insensitive by setting $caseSensitive to false.

Parameters

string $needle

Substring to look for

bool $caseSensitive

Whether or not to enforce case-sensitivity

Returns

bool —

Whether or not $str contains $needle

containsAll()

containsAll(string[]  $needles, bool  $caseSensitive = true) : bool

Returns true if the string contains all $needles, false otherwise. By default the comparison is case-sensitive, but can be made insensitive by setting $caseSensitive to false.

Parameters

string[] $needles

Substrings to look for

bool $caseSensitive

Whether or not to enforce case-sensitivity

Returns

bool —

Whether or not $str contains $needle

containsAny()

containsAny(string[]  $needles, bool  $caseSensitive = true) : bool

Returns true if the string contains any $needles, false otherwise. By default the comparison is case-sensitive, but can be made insensitive by setting $caseSensitive to false.

Parameters

string[] $needles

Substrings to look for

bool $caseSensitive

Whether or not to enforce case-sensitivity

Returns

bool —

Whether or not $str contains $needle

count()

count() : int

Returns the length of the string, implementing the countable interface.

Returns

int —

The number of characters in the string, given the encoding

countSubstr()

countSubstr(string  $substring, bool  $caseSensitive = true) : int

Returns the number of occurrences of $substring in the given string.

By default, the comparison is case-sensitive, but can be made insensitive by setting $caseSensitive to false.

Parameters

string $substring

The substring to search for

bool $caseSensitive

Whether or not to enforce case-sensitivity

Returns

int —

The number of $substring occurrences

dasherize()

dasherize() : static

Returns a lowercase and trimmed string separated by dashes. Dashes are inserted before uppercase characters (with the exception of the first character of the string), and in place of spaces as well as underscores.

Returns

static —

Object with a dasherized $str

delimit()

delimit(string  $delimiter) : static

Returns a lowercase and trimmed string separated by the given delimiter.

Delimiters are inserted before uppercase characters (with the exception of the first character of the string), and in place of spaces, dashes, and underscores. Alpha delimiters are not converted to lowercase.

Parameters

string $delimiter

Sequence used to separate parts of the string

Returns

static —

Object with a delimited $str

endsWith()

endsWith(string  $substring, bool  $caseSensitive = true) : bool

Returns true if the string ends with $substring, false otherwise. By default, the comparison is case-sensitive, but can be made insensitive by setting $caseSensitive to false.

Parameters

string $substring

The substring to look for

bool $caseSensitive

Whether or not to enforce case-sensitivity

Returns

bool —

Whether or not $str ends with $substring

endsWithAny()

endsWithAny(string[]  $substrings, bool  $caseSensitive = true) : bool

Returns true if the string ends with any of $substrings, false otherwise.

By default, the comparison is case-sensitive, but can be made insensitive by setting $caseSensitive to false.

Parameters

string[] $substrings

Substrings to look for

bool $caseSensitive

Whether or not to enforce case-sensitivity

Returns

bool —

Whether or not $str ends with $substring

ensureLeft()

ensureLeft(string  $substring) : static

Ensures that the string begins with $substring. If it doesn't, it's prepended.

Parameters

string $substring

The substring to add if not present

Returns

static —

Object with its $str prefixed by the $substring

ensureRight()

ensureRight(string  $substring) : static

Ensures that the string ends with $substring. If it doesn't, it's appended.

Parameters

string $substring

The substring to add if not present

Returns

static —

Object with its $str suffixed by the $substring

first()

first(int  $n) : static

Returns the first $n characters of the string.

Parameters

int $n

Number of characters to retrieve from the start

Returns

static —

Object with its $str being the first $n chars

getEncoding()

getEncoding() : string

Returns the encoding used by the Stringy object.

Returns

string —

The current value of the $encoding property

getIterator()

getIterator() : \ArrayIterator

Returns a new ArrayIterator, thus implementing the IteratorAggregate interface. The ArrayIterator's constructor is passed an array of chars in the multibyte string. This enables the use of foreach with instances of Stringy\Stringy.

Returns

\ArrayIterator —

An iterator for the characters in the string

hasLowerCase()

hasLowerCase() : bool

Returns true if the string contains a lower case char, false otherwise.

Returns

bool —

Whether or not the string contains a lower case character.

hasUpperCase()

hasUpperCase() : bool

Returns true if the string contains an upper case char, false otherwise.

Returns

bool —

Whether or not the string contains an upper case character.

htmlDecode()

htmlDecode(int|null  $flags = ENT_COMPAT) : static

Convert all HTML entities to their applicable characters. An alias of html_entity_decode. For a list of flags, refer to http://php.net/manual/en/function.html-entity-decode.php

Parameters

int|null $flags

Optional flags

Returns

static —

Object with the resulting $str after being html decoded.

htmlEncode()

htmlEncode(int|null  $flags = ENT_COMPAT) : static

Convert all applicable characters to HTML entities. An alias of htmlentities. Refer to http://php.net/manual/en/function.htmlentities.php for a list of flags.

Parameters

int|null $flags

Optional flags

Returns

static —

Object with the resulting $str after being html encoded.

humanize()

humanize() : static

Capitalizes the first word of the string, replaces underscores with spaces, and strips '_id'.

Returns

static —

Object with a humanized $str

indexOf()

indexOf(string  $needle, int  $offset) : int|bool

Returns the index of the first occurrence of $needle in the string, and false if not found. Accepts an optional offset from which to begin the search.

Parameters

string $needle

Substring to look for

int $offset

Offset from which to search

Returns

int|bool —

The occurrence's index if found, otherwise false

indexOfLast()

indexOfLast(string  $needle, int  $offset) : int|bool

Returns the index of the last occurrence of $needle in the string, and false if not found. Accepts an optional offset from which to begin the search. Offsets may be negative to count from the last character in the string.

Parameters

string $needle

Substring to look for

int $offset

Offset from which to search

Returns

int|bool —

The last occurrence's index if found, otherwise false

insert()

insert(string  $substring, int  $index) : static

Inserts $substring into the string at the $index provided.

Parameters

string $substring

String to be inserted

int $index

The index at which to insert the substring

Returns

static —

Object with the resulting $str after the insertion

isAlpha()

isAlpha() : bool

Returns true if the string contains only alphabetic chars, false otherwise.

Returns

bool —

Whether or not $str contains only alphabetic chars

isAlphanumeric()

isAlphanumeric() : bool

Returns true if the string contains only alphabetic and numeric chars, false otherwise.

Returns

bool —

Whether or not $str contains only alphanumeric chars

isBlank()

isBlank() : bool

Returns true if the string contains only whitespace chars, false otherwise.

Returns

bool —

Whether or not $str contains only whitespace characters

isHexadecimal()

isHexadecimal() : bool

Returns true if the string contains only hexadecimal chars, false otherwise.

Returns

bool —

Whether or not $str contains only hexadecimal chars

isJson()

isJson() : bool

Returns true if the string is JSON, false otherwise. Unlike json_decode in PHP 5.x, this method is consistent with PHP 7 and other JSON parsers, in that an empty string is not considered valid JSON.

Returns

bool —

Whether or not $str is JSON

isLowerCase()

isLowerCase() : bool

Returns true if the string contains only lower case chars, false otherwise.

Returns

bool —

Whether or not $str contains only lower case characters

isSerialized()

isSerialized() : bool

Returns true if the string is serialized, false otherwise.

Returns

bool —

Whether or not $str is serialized

isBase64()

isBase64() : bool

Returns true if the string is base64 encoded, false otherwise.

Returns

bool —

Whether or not $str is base64 encoded

isUpperCase()

isUpperCase() : bool

Returns true if the string contains only lower case chars, false otherwise.

Returns

bool —

Whether or not $str contains only lower case characters

last()

last(int  $n) : static

Returns the last $n characters of the string.

Parameters

int $n

Number of characters to retrieve from the end

Returns

static —

Object with its $str being the last $n chars

length()

length() : int

Returns the length of the string. An alias for PHP's mb_strlen() function.

Returns

int —

The number of characters in $str given the encoding

lines()

lines() : static[]

Splits on newlines and carriage returns, returning an array of Stringy objects corresponding to the lines in the string.

Returns

static[] —

An array of Stringy objects

longestCommonPrefix()

longestCommonPrefix(string  $otherStr) : static

Returns the longest common prefix between the string and $otherStr.

Parameters

string $otherStr

Second string for comparison

Returns

static —

Object with its $str being the longest common prefix

longestCommonSuffix()

longestCommonSuffix(string  $otherStr) : static

Returns the longest common suffix between the string and $otherStr.

Parameters

string $otherStr

Second string for comparison

Returns

static —

Object with its $str being the longest common suffix

longestCommonSubstring()

longestCommonSubstring(string  $otherStr) : static

Returns the longest common substring between the string and $otherStr.

In the case of ties, it returns that which occurs first.

Parameters

string $otherStr

Second string for comparison

Returns

static —

Object with its $str being the longest common substring

lowerCaseFirst()

lowerCaseFirst() : static

Converts the first character of the string to lower case.

Returns

static —

Object with the first character of $str being lower case

offsetExists()

offsetExists(mixed  $offset) : bool

Returns whether or not a character exists at an index. Offsets may be negative to count from the last character in the string. Implements part of the ArrayAccess interface.

Parameters

mixed $offset

The index to check

Returns

bool —

Whether or not the index exists

offsetGet()

offsetGet(mixed  $offset) : mixed

Returns the character at the given index. Offsets may be negative to count from the last character in the string. Implements part of the ArrayAccess interface, and throws an OutOfBoundsException if the index does not exist.

Parameters

mixed $offset

The index from which to retrieve the char

Throws

\OutOfBoundsException

If the positive or negative offset does not exist

Returns

mixed —

The character at the specified index

offsetSet()

offsetSet(mixed  $offset, mixed  $value) : mixed

Implements part of the ArrayAccess interface, but throws an exception when called. This maintains the immutability of Stringy objects.

Parameters

mixed $offset

The index of the character

mixed $value

Value to set

Throws

\Exception

When called

Returns

mixed —

offsetUnset()

offsetUnset(mixed  $offset) : mixed

Implements part of the ArrayAccess interface, but throws an exception when called. This maintains the immutability of Stringy objects.

Parameters

mixed $offset

The index of the character

Throws

\Exception

When called

Returns

mixed —

pad()

pad(int  $length, string  $padStr = ' ', string  $padType = 'right') : static

Pads the string to a given length with $padStr. If length is less than or equal to the length of the string, no padding takes places. The default string used for padding is a space, and the default type (one of 'left', 'right', 'both') is 'right'. Throws an InvalidArgumentException if $padType isn't one of those 3 values.

Parameters

int $length

Desired string length after padding

string $padStr

String used to pad, defaults to space

string $padType

One of 'left', 'right', 'both'

Throws

/InvalidArgumentException If $padType isn't one of 'right', 'left' or 'both'

Returns

static —

Object with a padded $str

padBoth()

padBoth(int  $length, string  $padStr = ' ') : static

Returns a new string of a given length such that both sides of the string are padded. Alias for pad() with a $padType of 'both'.

Parameters

int $length

Desired string length after padding

string $padStr

String used to pad, defaults to space

Returns

static —

String with padding applied

padLeft()

padLeft(int  $length, string  $padStr = ' ') : static

Returns a new string of a given length such that the beginning of the string is padded. Alias for pad() with a $padType of 'left'.

Parameters

int $length

Desired string length after padding

string $padStr

String used to pad, defaults to space

Returns

static —

String with left padding

padRight()

padRight(int  $length, string  $padStr = ' ') : static

Returns a new string of a given length such that the end of the string is padded. Alias for pad() with a $padType of 'right'.

Parameters

int $length

Desired string length after padding

string $padStr

String used to pad, defaults to space

Returns

static —

String with right padding

prepend()

prepend(string  $string) : static

Returns a new string starting with $string.

Parameters

string $string

The string to append

Returns

static —

Object with appended $string

regexReplace()

regexReplace(string  $pattern, string  $replacement, string  $options = 'msr') : static

Replaces all occurrences of $pattern in $str by $replacement. An alias for mb_ereg_replace(). Note that the 'i' option with multibyte patterns in mb_ereg_replace() requires PHP 5.6+ for correct results. This is due to a lack of support in the bundled version of Oniguruma in PHP < 5.6, and current versions of HHVM (3.8 and below).

Parameters

string $pattern

The regular expression pattern

string $replacement

The string to replace with

string $options

Matching conditions to be used

Returns

static —

Object with the resulting $str after the replacements

removeLeft()

removeLeft(string  $substring) : static

Returns a new string with the prefix $substring removed, if present.

Parameters

string $substring

The prefix to remove

Returns

static —

Object having a $str without the prefix $substring

removeRight()

removeRight(string  $substring) : static

Returns a new string with the suffix $substring removed, if present.

Parameters

string $substring

The suffix to remove

Returns

static —

Object having a $str without the suffix $substring

repeat()

repeat(int  $multiplier) : static

Returns a repeated string given a multiplier. An alias for str_repeat.

Parameters

int $multiplier

The number of times to repeat the string

Returns

static —

Object with a repeated str

replace()

replace(string  $search, string  $replacement) : static

Replaces all occurrences of $search in $str by $replacement.

Parameters

string $search

The needle to search for

string $replacement

The string to replace with

Returns

static —

Object with the resulting $str after the replacements

reverse()

reverse() : static

Returns a reversed string. A multibyte version of strrev().

Returns

static —

Object with a reversed $str

safeTruncate()

safeTruncate(int  $length, string  $substring = '') : static

Truncates the string to a given length, while ensuring that it does not split words. If $substring is provided, and truncating occurs, the string is further truncated so that the substring may be appended without exceeding the desired length.

Parameters

int $length

Desired length of the truncated string

string $substring

The substring to append if it can fit

Returns

static —

Object with the resulting $str after truncating

shuffle()

shuffle() : mixed

Returns

mixed —

slugify()

slugify(string  $replacement = '-', string  $language = 'en') : static

Converts the string into an URL slug. This includes replacing non-ASCII characters with their closest ASCII equivalents, removing remaining non-ASCII and non-alphanumeric characters, and replacing whitespace with $replacement. The replacement defaults to a single dash, and the string is also converted to lowercase. The language of the source string can also be supplied for language-specific transliteration.

Parameters

string $replacement

The string used to replace whitespace

string $language

Language of the source string

Returns

static —

Object whose $str has been converted to an URL slug

startsWith()

startsWith(string  $substring, bool  $caseSensitive = true) : bool

Returns true if the string begins with $substring, false otherwise. By default, the comparison is case-sensitive, but can be made insensitive by setting $caseSensitive to false.

Parameters

string $substring

The substring to look for

bool $caseSensitive

Whether or not to enforce case-sensitivity

Returns

bool —

Whether or not $str starts with $substring

startsWithAny()

startsWithAny(string[]  $substrings, bool  $caseSensitive = true) : bool

Returns true if the string begins with any of $substrings, false otherwise. By default the comparison is case-sensitive, but can be made insensitive by setting $caseSensitive to false.

Parameters

string[] $substrings

Substrings to look for

bool $caseSensitive

Whether or not to enforce case-sensitivity

Returns

bool —

Whether or not $str starts with $substring

slice()

slice(int  $start, int  $end = null) : static

Returns the substring beginning at $start, and up to, but not including the index specified by $end. If $end is omitted, the function extracts the remaining string. If $end is negative, it is computed from the end of the string.

Parameters

int $start

Initial index from which to begin extraction

int $end

Optional index at which to end extraction

Returns

static —

Object with its $str being the extracted substring

split()

split(string  $pattern, int  $limit = null) : static[]

Splits the string with the provided regular expression, returning an array of Stringy objects. An optional integer $limit will truncate the results.

Parameters

string $pattern

The regex with which to split the string

int $limit

Optional maximum number of results to return

Returns

static[] —

An array of Stringy objects

stripWhitespace()

stripWhitespace() : static

Strip all whitespace characters. This includes tabs and newline characters, as well as multibyte whitespace such as the thin space and ideographic space.

Returns

static —

Object with whitespace stripped

substr()

substr(int  $start, int  $length = null) : static

Returns the substring beginning at $start with the specified $length.

It differs from the mb_substr() function in that providing a $length of null will return the rest of the string, rather than an empty string.

Parameters

int $start

Position of the first character to use

int $length

Maximum number of characters used

Returns

static —

Object with its $str being the substring

surround()

surround(string  $substring) : static

Surrounds $str with the given substring.

Parameters

string $substring

The substring to add to both sides

Returns

static —

Object whose $str had the substring both prepended and appended

swapCase()

swapCase() : static

Returns a case swapped version of the string.

Returns

static —

Object whose $str has each character's case swapped

tidy()

tidy() : static

Returns a string with smart quotes, ellipsis characters, and dashes from Windows-1252 (commonly used in Word documents) replaced by their ASCII equivalents.

Returns

static —

Object whose $str has those characters removed

titleize()

titleize(array  $ignore = null) : static

Returns a trimmed string with the first letter of each word capitalized.

Also accepts an array, $ignore, allowing you to list words not to be capitalized.

Parameters

array $ignore

An array of words not to capitalize

Returns

static —

Object with a titleized $str

toAscii()

toAscii(string  $language = 'en', bool  $removeUnsupported = true) : static

Returns an ASCII version of the string. A set of non-ASCII characters are replaced with their closest ASCII counterparts, and the rest are removed by default. The language or locale of the source string can be supplied for language-specific transliteration in any of the following formats: en, en_GB, or en-GB. For example, passing "de" results in "äöü" mapping to "aeoeue" rather than "aou" as in other languages.

Parameters

string $language

Language of the source string

bool $removeUnsupported

Whether or not to remove the unsupported characters

Returns

static —

Object whose $str contains only ASCII characters

toBoolean()

toBoolean() : bool

Returns a boolean representation of the given logical string value.

For example, 'true', '1', 'on' and 'yes' will return true. 'false', '0', 'off', and 'no' will return false. In all instances, case is ignored. For other numeric strings, their sign will determine the return value. In addition, blank strings consisting of only whitespace will return false. For all other strings, the return value is a result of a boolean cast.

Returns

bool —

A boolean value for the string

toLowerCase()

toLowerCase() : static

Converts all characters in the string to lowercase. An alias for PHP's mb_strtolower().

Returns

static —

Object with all characters of $str being lowercase

toSpaces()

toSpaces(int  $tabLength = 4) : static

Converts each tab in the string to some number of spaces, as defined by $tabLength. By default, each tab is converted to 4 consecutive spaces.

Parameters

int $tabLength

Number of spaces to replace each tab with

Returns

static —

Object whose $str has had tabs switched to spaces

toTabs()

toTabs(int  $tabLength = 4) : static

Converts each occurrence of some consecutive number of spaces, as defined by $tabLength, to a tab. By default, each 4 consecutive spaces are converted to a tab.

Parameters

int $tabLength

Number of spaces to replace with a tab

Returns

static —

Object whose $str has had spaces switched to tabs

toTitleCase()

toTitleCase() : static

Converts the first character of each word in the string to uppercase.

Returns

static —

Object with all characters of $str being title-cased

toUpperCase()

toUpperCase() : static

Converts all characters in the string to uppercase. An alias for PHP's mb_strtoupper().

Returns

static —

Object with all characters of $str being uppercase

trim()

trim(string  $chars = null) : static

Returns a string with whitespace removed from the start and end of the string. Supports the removal of unicode whitespace. Accepts an optional string of characters to strip instead of the defaults.

Parameters

string $chars

Optional string of characters to strip

Returns

static —

Object with a trimmed $str

trimLeft()

trimLeft(string  $chars = null) : static

Returns a string with whitespace removed from the start of the string.

Supports the removal of unicode whitespace. Accepts an optional string of characters to strip instead of the defaults.

Parameters

string $chars

Optional string of characters to strip

Returns

static —

Object with a trimmed $str

trimRight()

trimRight(string  $chars = null) : static

Returns a string with whitespace removed from the end of the string.

Supports the removal of unicode whitespace. Accepts an optional string of characters to strip instead of the defaults.

Parameters

string $chars

Optional string of characters to strip

Returns

static —

Object with a trimmed $str

truncate()

truncate(int  $length, string  $substring = '') : static

Truncates the string to a given length. If $substring is provided, and truncating occurs, the string is further truncated so that the substring may be appended without exceeding the desired length.

Parameters

int $length

Desired length of the truncated string

string $substring

The substring to append if it can fit

Returns

static —

Object with the resulting $str after truncating

underscored()

underscored() : static

Returns a lowercase and trimmed string separated by underscores.

Underscores are inserted before uppercase characters (with the exception of the first character of the string), and in place of spaces as well as dashes.

Returns

static —

Object with an underscored $str

upperCamelize()

upperCamelize() : static

Returns an UpperCamelCase version of the supplied string. It trims surrounding spaces, capitalizes letters following digits, spaces, dashes and underscores, and removes spaces, dashes, underscores.

Returns

static —

Object with $str in UpperCamelCase

upperCaseFirst()

upperCaseFirst() : static

Converts the first character of the supplied string to upper case.

Returns

static —

Object with the first character of $str being upper case

charsArray()

charsArray() : array

Returns the replacements for the toAscii() method.

Returns

array —

An array of replacements.

langSpecificCharsArray()

langSpecificCharsArray(string  $language = 'en') : array

Returns language-specific replacements for the toAscii() method.

For example, German will map 'ä' to 'ae', while other languages will simply return 'a'.

Parameters

string $language

Language of the source string

Returns

array —

An array of replacements.

applyPadding()

applyPadding(int  $left, int  $right, string  $padStr = ' ') : static

Adds the specified amount of left and right padding to the given string.

The default character used is a space.

Parameters

int $left

Length of left padding

int $right

Length of right padding

string $padStr

String used to pad

Returns

static —

String with padding applied

matchesPattern()

matchesPattern(string  $pattern) : bool

Returns true if $str matches the supplied pattern, false otherwise.

Parameters

string $pattern

Regex pattern to match against

Returns

bool —

Whether or not $str matches the pattern

eregReplace()

eregReplace(mixed  $pattern, mixed  $replacement, mixed  $string, mixed  $option = 'msr') : mixed

Alias for mb_ereg_replace with a fallback to preg_replace if the mbstring module is not installed.

Parameters

mixed $pattern
mixed $replacement
mixed $string
mixed $option

Returns

mixed —

regexEncoding()

regexEncoding() : mixed

Alias for mb_regex_encoding which default to a noop if the mbstring module is not installed.

Returns

mixed —

supportsEncoding()

supportsEncoding() : mixed

Returns

mixed —