PHP Escape String
function escape($str) {
return str_replace(
array( '&', '<', '>', '"', '\''),
array( '&', '<', '>', '"', '''),
$str
);
}
NOTE: '
is not used as it is not a valid HTML entity reference.
Comments
Leave a Reply