// string htmlentities( string $string [, int $flags = ENT_COMPAT | ENT_HTML401
// [, string $encoding = ini_get("default_charset")
// [, bool $double_encode = true ]]])
$s = "I'll \"write\" 'the' <b>php</b> code";
echo htmlentities($s, ENT_QUOTES, "UTF-8"). "<br />\n";
echo htmlentities($s, ENT_QUOTES | ENT_IGNORE, "UTF-8");
/*
run:
I'll "write" 'the' <b>php</b> code
I'll "write" 'the' <b>php</b> code
I'll "write" 'the' <b>php</b> code<br />
I'll "write" 'the' <b>php</b> code
*/