久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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如何轉(zhuǎn)義單引號

      php轉(zhuǎn)義單引號的方法:使用【addslashes()】函數(shù)在指定的預(yù)定義字符前添加反斜杠,語法為【addslashes(string)】,string是必需,規(guī)定要檢查的字符串。

      php如何轉(zhuǎn)義單引號

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

      php轉(zhuǎn)義單引號的方法:

      PHP addslashes() 函數(shù)

      定義和用法

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

      這些預(yù)定義字符是:

      • 單引號 (')

      • 雙引號 (")

      • 反斜杠 ()

      • NULL

      語法

      addslashes(string)

      參數(shù) 描述

      string 必需。規(guī)定要檢查的字符串。

      提示和注釋

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

      注釋:

      默認(rèn)情況下,PHP 指令 magic_quotes_gpc 為 on,對所有的 GET、POST 和 COOKIE 數(shù)據(jù)自動運(yùn)行 addslashes()。

      不要對已經(jīng)被 magic_quotes_gpc 轉(zhuǎn)義過的字符串使用 addslashes(),因?yàn)檫@樣會導(dǎo)致雙層轉(zhuǎn)義。遇到這種情況時可以使用函數(shù) get_magic_quotes_gpc() 進(jìn)行檢測。

      例子

      在本例中,我們要向字符串中的預(yù)定義添加反斜杠:

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

      輸出:

      Who's John Adams? This is not safe in a database query.Who's John Adams? This is safe in a database query.

      一般按以下形式使用

      if(!(get_magic_quotes_gpc())) { $_GET = addslashes($_GET); $_POST = addslashes($_POST);     $_COOKIE = addslashes($_COOKIE); }

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

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