久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

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

      php如何去除轉(zhuǎn)義字符中的反斜杠

      php去除轉(zhuǎn)義字符中的反斜杠的方法:使用函數(shù)stripslashes去掉轉(zhuǎn)義后字符串中的反斜杠,代碼為【if (is_string($v)) {$array[$k] = stripslashes($v);}】。

      php如何去除轉(zhuǎn)義字符中的反斜杠

      本教程操作環(huán)境:windows7系統(tǒng)、PHP5.6版,DELL G3電腦。

      php去除轉(zhuǎn)義字符中的反斜杠的方法:

      addslashes函數(shù)主要是在字符串中添加反斜杠對(duì)特殊字符進(jìn)行轉(zhuǎn)義,stripslashes則是去掉轉(zhuǎn)義后字符串中的反斜杠,比如當(dāng)你提交一段json數(shù)據(jù)到PHP端的時(shí)候可能會(huì)遇到j(luò)son字符串中有導(dǎo)致json_decode函數(shù)無(wú)法將json數(shù)據(jù)轉(zhuǎn)換成數(shù)組的情況,這時(shí)你就需要stripslashes函數(shù)。

      該函數(shù)用于清理從數(shù)據(jù)庫(kù)或 HTML 表單中取回的數(shù)據(jù)。

      例子

      輸出:

      Who's John Adams? <?php function delete_fxg(&$array) {          while(list($k,$v) = each($array)) {                if (is_string($v)) {                    $array[$k] = stripslashes($v);//去掉反斜杠字符                }                if (is_array($v))  {                    $array[$k] = delete_fxg($v);//調(diào)用本身,遞歸作用               }         }         return $array; } $str[0][1]="123123\\"; $str[0][2]="456456\\"; delete_fxg($str); print_r($str); ?>

      相關(guān)視頻推薦:PHP視頻教程

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