htmlentities

htmlentities --  適用可能な文字を全て HTML エンティティに変換する

説明

string htmlentities(string string);

この関数はhtmlspecialcharsと同じですが、 HTML エンティティと等価な意味を有する文字を HTML エンティティに変換します。

現在のところ、ISO-8859-1 文字セットが使われます。

htmlspecialchars および nl2brも参照下さい。