HTMLのエスケープ処理

エスケープ処理のメモ。

$str = htmlentities($str, ENT_QUOTES, mb_internal_encoding());

mb_internal_encoding() は utf-8 指定でもいいかな。