当前位置: 首页>>代码示例>>PHP>>正文


PHP adodb_str_replace函数代码示例

本文整理汇总了PHP中adodb_str_replace函数的典型用法代码示例。如果您正苦于以下问题:PHP adodb_str_replace函数的具体用法?PHP adodb_str_replace怎么用?PHP adodb_str_replace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了adodb_str_replace函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: qstr

 function qstr($s, $magic_quotes = false)
 {
     if (!$magic_quotes) {
         if (ADODB_PHPVER >= 0x4300) {
             if (is_resource($this->_connectionID)) {
                 return "'" . mysql_real_escape_string($s, $this->_connectionID) . "'";
             }
         }
         if ($this->replaceQuote[0] == '\\') {
             $s = adodb_str_replace(array('\\', ""), array('\\\\', "\\"), $s);
         }
         return "'" . str_replace("'", $this->replaceQuote, $s) . "'";
     }
     // undo magic quotes for "
     $s = str_replace('\\"', '"', $s);
     return "'{$s}'";
 }
开发者ID:katopenzz,项目名称:openemr,代码行数:17,代码来源:adodb-mysql.inc.php

示例2: qstr

 /**
  * Correctly quotes a string so that all strings are escaped. We prefix and append
  * to the string single-quotes.
  * An example is  $db->qstr("Don't bother",magic_quotes_runtime());
  * 
  * @param s			the string to quote
  * @param [magic_quotes]	if $s is GET/POST var, set to get_magic_quotes_gpc().
  *				This undoes the stupidity of magic quotes for GPC.
  *
  * @return  quoted string to be sent back to database
  */
 function qstr($s, $magic_quotes = false)
 {
     if (!$magic_quotes) {
         if ($this->replaceQuote[0] == '\\') {
             // only since php 4.0.5
             $s = adodb_str_replace(array('\\', ""), array('\\\\', "\\"), $s);
             //$s = str_replace("\0","\\\0", str_replace('\\','\\\\',$s));
         }
         return "'" . str_replace("'", $this->replaceQuote, $s) . "'";
     }
     // undo magic quotes for "
     $s = str_replace('\\"', '"', $s);
     if ($this->replaceQuote == "\\'") {
         // ' already quoted, no need to change anything
         return "'{$s}'";
     } else {
         // change \' to '' for sybase/mssql
         $s = str_replace('\\\\', '\\', $s);
         return "'" . str_replace("\\'", $this->replaceQuote, $s) . "'";
     }
 }
开发者ID:dasatti,项目名称:dashboard,代码行数:32,代码来源:adodb.inc.php

示例3: _decode

 function _decode($blob)
 {
     eval('$realblob="' . adodb_str_replace(array('"', '$'), array('\\"', '\\$'), $blob) . '";');
     return $realblob;
 }
开发者ID:dasatti,项目名称:dashboard,代码行数:5,代码来源:adodb-postgres64.inc.php

示例4: qstr

 function qstr($s, $magic_quotes = false)
 {
     if (is_null($s)) {
         return 'NULL';
     }
     if (!$magic_quotes) {
         if (PHP_VERSION >= 5) {
             return "'" . mysqli_real_escape_string($this->_connectionID, $s) . "'";
         }
         if ($this->replaceQuote[0] == '\\') {
             $s = adodb_str_replace(array('\\', ""), array('\\\\', "\\"), $s);
         }
         return "'" . str_replace("'", $this->replaceQuote, $s) . "'";
     }
     // undo magic quotes for "
     $s = str_replace('\\"', '"', $s);
     return "'{$s}'";
 }
开发者ID:humor-zo,项目名称:chaofan,代码行数:18,代码来源:adodb-mysqli.inc.php

示例5: BlobEncode

 function BlobEncode($blob)
 {
     if (ADODB_PHPVER >= 0x5200) {
         return pg_escape_bytea($this->_connectionID, $blob);
     }
     if (ADODB_PHPVER >= 0x4200) {
         return pg_escape_bytea($blob);
     }
     /*92=backslash, 0=null, 39=single-quote*/
     $badch = array(chr(92), chr(0), chr(39));
     # \  null  '
     $fixch = array('\\\\134', '\\\\000', '\\\\047');
     return adodb_str_replace($badch, $fixch, $blob);
     // note that there is a pg_escape_bytea function only for php 4.2.0 or later
 }
开发者ID:nicolas34732,项目名称:address_book,代码行数:15,代码来源:adodb-postgres64.inc.php

示例6: qstr

	function qstr($s, $magic_quotes = false)
	{
		if (!$magic_quotes) {
	    	if (PHP_VERSION >= 5)
	      		return "'" . mysqli_real_escape_string($this->_connectionID, $s) . "'";   
	    
		if ($this->replaceQuote[0] == '\\')
			$s = adodb_str_replace(array('\\',"\0"),array('\\\\',"\\\0"),$s);
	    return  "'".str_replace("'",$this->replaceQuote,$s)."'"; 
	  }
	  // undo magic quotes for "
	  $s = str_replace('\\"','"',$s);
	  return "'$s'";
	}
开发者ID:songchin,项目名称:Cacti,代码行数:14,代码来源:adodb-mysqli.inc.php

示例7: qstr

 /**
  * Correctly quotes a string so that all strings are escaped. We prefix and append
  * to the string single-quotes.
  * An example is  $db->qstr("Don't bother");
  *
  * @param s			the string to quote
  *
  * @return  quoted string to be sent back to database
  */
 public function qstr($s)
 {
     if ($this->replaceQuote[0] == '\\') {
         // only since php 4.0.5
         $s = adodb_str_replace(array('\\', ""), array('\\\\', "\\"), $s);
         //$s = str_replace("\0","\\\0", str_replace('\\','\\\\',$s));
     }
     return "'" . str_replace("'", $this->replaceQuote, $s) . "'";
 }
开发者ID:bermi,项目名称:akelos,代码行数:18,代码来源:adodb.inc.php

示例8: qstr

 function qstr($s, $magic_quotes = false)
 {
     if (!$magic_quotes) {
         if (ADODB_PHPVER >= 0x5000) {
             //  $this->_connectionID = $this->mysqli_resolve_link($this->_connectionID);
             return "'" . mysqli_real_escape_string($this->_connectionID, $s) . "'";
         } else {
             trigger_error("phpver < 5 not implemented", E_USER_ERROR);
         }
         if ($this->replaceQuote[0] == '\\') {
             $s = adodb_str_replace(array('\\', ""), array('\\\\', "\\"), $s);
         }
         return "'" . str_replace("'", $this->replaceQuote, $s) . "'";
     }
     // undo magic quotes for "
     $s = str_replace('\\"', '"', $s);
     return "'{$s}'";
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:18,代码来源:adodb-mysqli.inc+(1).php

示例9: _decode

	function _decode($blob)
	{
		if ($blob === NULL) return NULL;
		eval('$realblob="'.adodb_str_replace(array('"','$'),array('\"','\$'),$blob).'";');
		return $realblob;
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:6,代码来源:adodb-postgres64.inc.php


注:本文中的adodb_str_replace函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。