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

(singke) #1

By now you most likely understand regular expressions, but one new idea is worth
noting. The call to ereg_replace in Listing 16.5 uses an integer to stand for a
linefeed. This is because ASCII 10 is a linefeed character. You might think of using
backslash-n here, but that would not give the results you want. Recall that the backslash
character in regular expressions causes the character to be treated literally. The
ereg_replace function allows you to specify a single character by ASCII value for its
first argument.

Free download pdf