久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      php addslashes 轉(zhuǎn)義的方法

      php addslashes轉(zhuǎn)義的方法:首先創(chuàng)建一個PHP示例文件;然后定義一個字符串;最后通過“addslashes($str)”向字符串中的預(yù)定義字符添加反斜杠即可。

      php addslashes 轉(zhuǎn)義的方法

      本文操作環(huán)境:windows7系統(tǒng)、PHP7.1版,DELL G3電腦

      addslashes定義和用法

      addslashes() 函數(shù)返回在預(yù)定義字符之前添加反斜杠的字符串。

      預(yù)定義字符是:

      單引號(')

      雙引號(")

      反斜杠()

      NULL

      提示:該函數(shù)可用于為存儲在數(shù)據(jù)庫中的字符串以及數(shù)據(jù)庫查詢語句準備字符串。

      注釋:默認地,PHP 對所有的 GET、POST 和 COOKIE 數(shù)據(jù)自動運行 addslashes()。所以您不應(yīng)對已轉(zhuǎn)義過的字符串使用 addslashes(),因為這樣會導(dǎo)致雙層轉(zhuǎn)義。遇到這種情況時可以使用函數(shù) get_magic_quotes_gpc() 進行檢測。

      語法

      addslashes(string)

      參數(shù)

      string 必需。規(guī)定要轉(zhuǎn)義的字符串。

      技術(shù)細節(jié)

      返回值: 返回已轉(zhuǎn)義的字符串。

      PHP 版本: 4+

      例子

      向字符串中的預(yù)定義字符添加反斜杠:

      <?php $str = "Who's Bill Gates?"; echo $str . " This is not safe in a database query.<br>"; echo addslashes($str) . " This is safe in a database query."; ?>

      輸出:

      Who's Bill Gates? This is not safe in a database query. Who's Bill Gates? This is safe in a database query.

      【推薦學(xué)習(xí):《PHP視頻教程》】

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