今天用了stripslashes指令,但是怎麼用,就是有1組反斜線去不掉,最後我回到php官網,看到了一個涵式的用法,試了之後,可以達成我要的功能,我覺得還不錯用,寫來一下Memo。
function stripslashes_deep($value)
{
$value = is_array($value) ?
array_map('stripslashes_deep', $value) :
stripslashes($value);
return $value;
}
呼叫更簡單
$abc=stripslashes_deep
(原字串);
隨機文章
- MIUI 開發版雲端儲存 (2016-02-04)
- 從responsibility進化到accountability (2011-08-19)
- WPS 專業版 實驗結果 (2009-02-16)
- Amazon的Kindle Fire打到誰?蘋果(Apple iOS)還是安卓(Google Android) (2012-01-07)
- 燈會…主燈… (2017-02-04)