QuoteMeta

QuoteMeta -- メタ文字をクォートする

説明

string quotemeta(string str);

文字列strについて、
. \\ + * ? [ ^ ] ( $ )
の間にあるすべての文字 の前にバックスラッシュ文字(\)でクォート して返します。

addslashes(), htmlentities(), htmlspecialchars(), nl2br(), stripslashes() も参照下さい。