一、存入資料庫前,檢查字串最後一個字元,若為反斜線〝\〞則在字串最後加上一個空白字元" "。
        加在ModifyTo()
        if(substr($this->modified_str, -1, 1) == "\\"){
             $this->modified_str .= ' ';
       } 
        class ModifyErrBig5增加 function ModifyAddSpace()
         function ModifyAddSpace($str){
              $this->modified_str = $str;
              if(substr($this->modified_str, -1, 1) == "\\"){
                   $this->modified_str .= ' ';
             }
              return  $this->modified_str;
         }
二、查詢字串,加上stripslashes()去除魔術引號加上的反斜線〝\〞,例:stripslashes(trim($_POST['txtqry']))。
arrow
arrow
    全站熱搜

    yoonow 發表在 痞客邦 留言(0) 人氣()