htmlspecialcharsEx
string htmlspecialcharsEx( string text );
The function converts text to HTML safe format, replacing special symbols with the corresponding HTML entities:
Original symbols | After replacement |
---|---|
< | < |
> | > |
" | " |
" | &quot; |
& | &amp; |
< | &lt; |
> | &gt; |
Note: Unlike the standard htmlspecialchars PHP function, this function allows to specify symbols in the format: &symbol_code;
Function parameters
Parameter | Description |
---|---|
text | Text to be converted. |
See Also
Examples of use
<? $text = '"if a>b and b>c, then a>c"'; $res = htmlspecialcharsEx($text); // $res now contains: // "if a>b and b>c, then a>c" echo $res; // output: // "if a>b and b>c, then a>c" ?>
© «Bitrix24», 2001-2024