- var_export: documentation ( source)
- htmlentities: documentation ( source)
- htmlspecialchars: documentation ( source)
<?php
$string = "<b>I like 'PHP' & I think it is \"cool\"</b>";
echo "\n";
echo var_export(htmlentities($string, ENT_QUOTES), true);
echo "\n";
echo var_export(htmlspecialchars($string), true);
?>