Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

transliterator.transliterate(3) [php man page]

TRANSLITERATOR.TRANSLITERATE(3) 					 1					   TRANSLITERATOR.TRANSLITERATE(3)

Transliterator::transliterate - Transliterate a string

       Object oriented style

SYNOPSIS
public string Transliterator::transliterate (string $subject, [int $start], [int $end]) DESCRIPTION
Procedural style transliterator_transliterate (mixed $transliterator, string $subject, [int $start], [int $end]) Transforms a string or part thereof using an ICU transliterator. PARAMETERS
o $transliterator - In the procedural version, either a Transliterator or a string from which a Transliterator can be built. o $subject - The string to be transformed. o $start - The start index (in UTF-16 code units) from which the string will start to be transformed, inclusive. Indexing starts at 0. The text before will be left as is. o $end - The end index (in UTF-16 code units) until which the string will be transformed, exclusive. Indexing starts at 0. The text after will be left as is. RETURN VALUES
The transfomed string on success, or FALSE on failure. EXAMPLES
Example #1 Converting escaped UTF-16 code units <?php $s = "u304Au65E9u3046u3054u3056u3044u307Eu3059"; echo transliterator_transliterate("Hex-Any/Java", $s), " "; //now the reverse operation with a supplementary character $supplChar = html_entity_decode('&#x1D11E;'); echo mb_strlen($supplChar, "UTF-8"), " "; $encSupplChar = transliterator_transliterate("Any-Hex/Java", $supplChar); //echoes two encoded UTF-16 code units echo $encSupplChar, " "; //and back echo transliterator_transliterate("Hex-Any/Java", $encSupplChar), " "; ?> The above example will output something similar to: 1 uD834uDD1E SEE ALSO
Transliterator::getErrorMessage, Transliterator::__construct. PHP Documentation Group TRANSLITERATOR.TRANSLITERATE(3)

Check Out this Related Man Page

GRAPHEME_EXTRACT(3)							 1						       GRAPHEME_EXTRACT(3)

grapheme_extract - Function to extract a sequence of default grapheme clusters from a text buffer, which must be encoded in UTF-8.

       Procedural style

SYNOPSIS
string grapheme_extract (string $haystack, int $size, [int $extract_type], [int $start], [int &$next]) DESCRIPTION
Function to extract a sequence of default grapheme clusters from a text buffer, which must be encoded in UTF-8. PARAMETERS
o $haystack - String to search. o $size - Maximum number items - based on the $extract_type - to return. o $extract_type - Defines the type of units referred to by the $size parameter: oGRAPHEME_EXTR_COUNT (default) - $size is the number of default grapheme clusters to extract. oGRAPHEME_EXTR_MAXBYTES - $size is the maximum number of bytes returned. oGRAPHEME_EXTR_MAXCHARS - $size is the maximum number of UTF-8 characters returned. o $start - Starting position in $haystack in bytes - if given, it must be zero or a positive value that is less than or equal to the length of $haystack in bytes. If $start does not point to the first byte of a UTF-8 character, the start position is moved to the next character boundary. o $next - Reference to a value that will be set to the next starting position. When the call returns, this may point to the first byte position past the end of the string. RETURN VALUES
A string starting at offset $start and ending on a default grapheme cluster boundary that conforms to the $size and $extract_type speci- fied. EXAMPLES
Example #1 grapheme_extract(3) example <?php $char_a_ring_nfd = "axCCx8A"; // 'LATIN SMALL LETTER A WITH RING ABOVE' (U+00E5) normalization form "D" $char_o_diaeresis_nfd = "oxCCx88"; // 'LATIN SMALL LETTER O WITH DIAERESIS' (U+00F6) normalization form "D" print urlencode(grapheme_extract( $char_a_ring_nfd . $char_o_diaeresis_nfd, 1, GRAPHEME_EXTR_COUNT, 2)); ?> The above example will output: o%CC%88 SEE ALSO
grapheme_substr(3), Unicode Text Segmentation: Grapheme Cluster Boundaries . PHP Documentation Group GRAPHEME_EXTRACT(3)
Man Page