Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites

(singke) #1

^ Caret
( Left Parenthesis


) Right Parenthesis
[ Left Square Bracket
] Right Square Bracket
{ Left Curly Brace
} Right Curly Brace
$ Dollar Sign
\ Backslash


ASCII 10 Linefeed
ASCII 255


string hebrev(string text, integer length)


Unlike English, Hebrew text reads right to left, which makes working with strings
inconvenient at times. The hebrev function reverses the orientation of Hebrew text, but
leaves English alone. Hebrew characters are assumed to be in the ASCII range 224
through 251, inclusive. The optional length argument specifies a maximum length per
line. Lines that exceed this length are broken.


<?


print(hebrev("Hebrew"));
?>


string hebrevc(string text, integer length)


The hebrevc function operates exactly like hebrev, except that BR tags are inserted
before end-of-line characters.


string htmlentities(string text)


The htmlentities function returns the text argument with certain characters
translated into HTML entities. Table 9.5 lists entities supported.


This list conforms to the ISO-8859-1 standard. The nl2br function is similar: it
translates line breaks to BR tags. You can use strip_tags to remove HTML tags
altogether.


<?


$text = "Use to begin a document.";
print(htmlentities($text));

Free download pdf