11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 9 • STRINGS AND REGULAR EXPRESSIONSwww.it-ebooks.infoBecause of the special nature of quote marks within markup, the optional quote_style parameteroffers the opportunity to choose how they will be handled. Three values are accepted:ENT_COMPAT: Convert double quotes and ignore single quotes. This is the default.ENT_NOQUOTES: Ignore both double and single quotes.ENT_QUOTES: Convert both double and single quotes.A second optional parameter, charset, determines the character set used for the conversion. Table9-2 offers the list of supported character sets. If charset is omitted, it will default to ISO-8859-1.Table 9-2. htmlentities()’s Supported Character SetsCharacter SetBIG5BIG5-HKSCScp866cp1251cp1252EUC-JPGB2312ISO-8859-1ISO-8859-15KOI8-RShift_JISUTF-8DescriptionTraditional ChineseBIG5 with additional Hong Kong extensions, traditional ChineseDOS-specific Cyrillic character setWindows-specific Cyrillic character setWindows-specific character set for Western EuropeJapaneseSimplified ChineseWestern European, Latin-1Western European, Latin-9RussianJapaneseASCII-compatible multibyte 8 encodeThe final optional parameter double_encode will prevent htmlentities() from encoding any HTMLentities that already exist in the string. In most cases you’ll probably want to enable this parameter if yoususpect HTML entities already exist in the target string.The following example converts the necessary characters for web display:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!