| Versions | |
|---|---|
| 4.7 – 7 | check_plain($text) |
Encode special characters in a plain-text string for display as HTML.
Also validates strings as UTF-8 to prevent cross site scripting attacks on Internet Explorer 6.
$text The text to be checked or processed.
An HTML safe version of $text, or an empty string if $text is not valid UTF-8.
drupal/
<?php
function check_plain($text) {
return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
}
?> 