定義和用法FILTER_SANITIZE_MAGIC_QUOTES 過濾器對字串執行addslashes() 函數。此過濾器在預先定義的字串前面設定反斜線。預定義字元是:單引號(')雙引號(")反斜線(\) NULL FILTER_SANITIZE_MAGIC_QUOTES 資訊: Name: "magic_quotes" ID-number: 521實例<?php $var = " Peter's here! " ; var_dump ( filter_var ( $var , FILTER_SANITIZE_MAGIC_QUOTES ) ) ; ? >程式碼的輸出如下所示: string(14) "Peter\'s here!"