Zend\Stdlib\StringUtils
Utility class for handling strings of different character encodings using available PHP extensions.
Declared abstract, as we have no need for instantiation.
Synopsis
class StringUtils
{
- // members
- protected array $wrapperRegistry;
- protected array $singleByteEncodings;
- protected bool $hasPcreUnicodeSupport;
- // methods
- public static array getRegisteredWrappers()
- public static void registerWrapper()
- public static void unregisterWrapper()
- public static void resetRegisteredWrappers()
- public static StringWrapperInterface getWrapper()
- public static array getSingleByteEncodings()
- public static bool isSingleByteEncoding()
- public static bool isValidUtf8()
- public static bool hasPcreUnicodeSupport()
Members
protected
- $hasPcreUnicodeSupport
—
Zend\Stdlib\bool
Is PCRE compiled with Unicode support? - $singleByteEncodings
—
array
A list of known single-byte character encodings (upper-case) - $wrapperRegistry
—
array
Ordered list of registered string wrapper instances
Methods
public
- getRegisteredWrappers() — Get registered wrapper classes
- getSingleByteEncodings() — Get a list of all known single-byte character encodings
- getWrapper() — Get the first string wrapper supporting the given character encoding and supports to convert into the given convert encoding.
- hasPcreUnicodeSupport() — Is PCRE compiled with Unicode support?
- isSingleByteEncoding() — Check if a given encoding is a known single-byte character encoding
- isValidUtf8() — Check if a given string is valid UTF-8 encoded
- registerWrapper() — Register a string wrapper class
- resetRegisteredWrappers() — Reset all registered wrappers so the default wrappers will be used
- unregisterWrapper() — Unregister a string wrapper class