-
Book Overview & Buying
-
Table Of Contents
PHP 7 Programming Cookbook
By :
The ability to access the entire Unicode character set opens up many new possibilities for rendering complex characters, especially characters in alphabets other than Latin-1.
Some languages are read right-to-left instead of left-to-right. Examples include Hebrew and Arabic. In this example, we show you how to present reverse text using the U+202E Unicode character for right-to-left override. The following line of code prints txet desreveR:
echo "\u{202E}Reversed text";
echo "\u{202D}"; // returns output to left-to-rightDon't forget to invoke the left-to-right override character, U+202D, when finished!
Another consideration is the use of composed characters. One such example is ñ (the letter n with a tilde ~ floating above). This is used in words such as mañana (the Spanish word for morning or tomorrow, depending on the context). There is a composed character available, represented by Unicode code U+00F1. Here is an example of its use, which...