文字を解析する時に役立つ前処理

## 改行削除
$text= ereg_replace("\r|\n","",$text);

## スラッシュでクォートする
$text = addslashes($text);

## タグ文字を削除する
$text = strip_tags($text);

## 文字をHTML エンティティにする。
$text = htmlspecialchars($text);

## HTMLエンティティを文字に戻します。
$text = htmlspecialchars_decode($text);