亚洲最大看欧美片,亚洲图揄拍自拍另类图片,欧美精品v国产精品v呦,日本在线精品视频免费

  • 站長(zhǎng)資訊網(wǎng)
    最全最豐富的資訊網(wǎng)站

    php如何去掉轉(zhuǎn)義字符

    php去掉轉(zhuǎn)義字符的方法:首先找到需要去除轉(zhuǎn)義字符并打開(kāi)源代碼;然后返回一個(gè)去除轉(zhuǎn)義反斜線后的字符串,代碼為【string stripslashes ( string $str )】。

    php如何去掉轉(zhuǎn)義字符

    php去掉轉(zhuǎn)義字符的方法:

    string stripslashes ( string $str )

    返回一個(gè)去除轉(zhuǎn)義反斜線后的字符串(' 轉(zhuǎn)換為 ' 等等)。雙反斜線(\)被轉(zhuǎn)換為單個(gè)反斜線()。

    stripslashes() 是非遞歸的。如果你想要在多維數(shù)組中使用該函數(shù),你需要使用遞歸函數(shù)。

    <?php function stripslashes_deep($value) {     $value = is_array($value) ?                 array_map('stripslashes_deep', $value) :                 stripslashes($value);     return $value; } // 范例 $array = array("f\'oo", "b\'ar", array("fo\'o", "b\'ar")); $array = stripslashes_deep($array); // 輸出 print_r($array); ?>

    以上輸出:

    Array (     [0] => f'oo     [1] => b'ar     [2] => Array         (             [0] => fo'o             [1] => b'ar         ) )

    相關(guān)學(xué)習(xí)推薦:php編程(視頻)

    贊(0)
    分享到: 更多 (0)
    網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)