Class StringUtils

Summary

Fully Qualified Name: Zend\Stdlib\StringUtils

Description

Utility class for handling strings of different character encodings using available PHP extensions.

Declared abstract, as we have no need for instantiation.

Methods

Name Description Defined By
getRegisteredWrappers() Get registered wrapper classes StringUtils
getSingleByteEncodings() Get a list of all known single-byte character encodings StringUtils
getWrapper() Get the first string wrapper supporting the given character encoding and supports to convert into the given convert encoding. StringUtils
hasPcreUnicodeSupport() Is PCRE compiled with Unicode support? StringUtils
isSingleByteEncoding() Check if a given encoding is a known single-byte character encoding StringUtils
isValidUtf8() Check if a given string is valid UTF-8 encoded StringUtils
registerWrapper() Register a string wrapper class StringUtils
resetRegisteredWrappers() Reset all registered wrappers so the default wrappers will be used StringUtils
unregisterWrapper() Unregister a string wrapper class StringUtils

Method Details

getRegisteredWrappers()

Get registered wrapper classes

Returns: string[]

getSingleByteEncodings()

Get a list of all known single-byte character encodings

Returns: string[]

getWrapper()

Get the first string wrapper supporting the given character encoding and supports to convert into the given convert encoding.

Parameter Name Type Description
$encoding string Character
$convertEncoding string|null OPTIONAL

Returns: \StringWrapperInterface

hasPcreUnicodeSupport()

Is PCRE compiled with Unicode support?

Returns: bool

isSingleByteEncoding()

Check if a given encoding is a known single-byte character encoding

Parameter Name Type Description
$encoding string

Returns: bool

isValidUtf8()

Check if a given string is valid UTF-8 encoded

Parameter Name Type Description
$str string

Returns: bool

registerWrapper()

Register a string wrapper class

Parameter Name Type Description
$wrapper string

Returns: void

resetRegisteredWrappers()

Reset all registered wrappers so the default wrappers will be used

Returns: void

unregisterWrapper()

Unregister a string wrapper class

Parameter Name Type Description
$wrapper string

Returns: void

Top