Function __global->htmlspecialchars
Definitions
sources_custom/phpstub.php
- Convert all basic HTML encoding characters to HTML entities.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: string
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $string | string | No | No | required parameter | N/A | N/A | The string to encode |
| $quote_style | integer | No | No | 2 | N/A | N/A | The quote style (ENT_COMPAT, ENT_QUOTES, ENT_NOQUOTES) |
| $charset | string | No | No | Blank (empty string) | N/A | N/A | The character set to use |
Returns
- The encoded string
- Type: string
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Convert all basic HTML encoding characters to HTML entities.
*
* @param string $string The string to encode
* @param integer $quote_style The quote style (ENT_COMPAT, ENT_QUOTES, ENT_NOQUOTES)
* @param string $charset The character set to use
* @return string The encoded string
*/
function htmlspecialchars(string $string, int $quote_style = 2, string $charset = '') : string
* Convert all basic HTML encoding characters to HTML entities.
*
* @param string $string The string to encode
* @param integer $quote_style The quote style (ENT_COMPAT, ENT_QUOTES, ENT_NOQUOTES)
* @param string $charset The character set to use
* @return string The encoded string
*/
function htmlspecialchars(string $string, int $quote_style = 2, string $charset = '') : string

