## 例

`

     string htmlspecialchars ( string $string [, int $flags = ENT_COMPAT | ENT_HTML401 [, string $charset [, bool $double_encode = true ]]] )

`

## 説明

Certain characters have special significance in HTML, and should be represented by HTML entities if they are to preserve their meanings. This function returns a string with some of these conversions made; the translations made are those most useful for everyday web programming. If you require all HTML character entities to be translated, use htmlentities() instead. This function is useful in preventing user-supplied text from containing HTML markup, such as in a message board or guest book application. The translations performed are: '&' (ampersand) becomes '&amp;' '"' (double quote) becomes '&quot;' when ENT_NOQUOTES is not set. "'" (single quote) becomes '&#039;' only when ENT_QUOTES is set. '<`' (less than) becomes '&lt;' '`>' (greater than) becomes '&gt;'

## 戻り値

The converted string. If the input string contains an invalid code unit sequence within the given charset and the ENT_IGNORE flag is not set, then htmlspecialchars() will return an empty string.