PHP 字符串 stripcslashes()函數
stripcslashes()是PHP的預定義函數。愛掏網 - it200.com它用于刪除反斜杠并清理從數據庫或HTML表單中檢索到的數據。愛掏網 - it200.com它返回一個去掉反斜杠的字符串。愛掏網 - it200.com
當需要刪除反斜杠時,這個stripcslashes()函數非常重要。愛掏網 - it200.com
string stripcslashes ( string $str );
參數 | 描述 | 必需/可選 |
---|---|---|
string | 用于指定要檢查的字符串 | 必需 |
示例1
<?php
str="Hello PHP!";
echo "Your String is:".str;
echo "<br>";
echo "By using stripcslashes() Function".stripcslashes($str);
?>
輸出:
Hello PHP!
示例2
<?php
string="Hello, we areLearning PHP from javaTpoint.";
echo "Before using 'stripcslashes()' Function: ".string;
echo "<br>";
echo "By using 'stripcslashes()' Function:".stripcslashes($string);
?>
輸出:
Before using 'stripcslashes()' Function: Hello, we areLearning PHP from javaTpoint.
By using 'stripcslashes()' Function: Hello, we areLearning PHP from javaTpoint.
參考:
http://php.net/manual/en/function.stripcslashes.php
聲明:所有內容來自互聯網搜索結果,不保證100%準確性,僅供參考。如若本站內容侵犯了原著者的合法權益,可聯系我們進行處理。