本文整理汇总了PHP中addslashes_deep_obj函数的典型用法代码示例。如果您正苦于以下问题:PHP addslashes_deep_obj函数的具体用法?PHP addslashes_deep_obj怎么用?PHP addslashes_deep_obj使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了addslashes_deep_obj函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: decode
function decode($text, $type = 0)
{
if (empty($text)) {
return '';
} elseif (!is_string($text)) {
return false;
}
return addslashes_deep_obj(json_decode(stripslashes($text), $type));
}
示例2: decode
function decode($text, $type = 0)
{
if (empty($text)) {
return '';
} elseif (!is_string($text)) {
return false;
}
if (EC_CHARSET === 'utf-8' && function_exists('json_decode')) {
return addslashes_deep_obj(json_decode(stripslashes($text), $type));
}
$this->at = 0;
$this->ch = '';
$this->text = strtr(stripslashes($text), array("\r" => '', "\n" => '', "\t" => '', "\\b" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "\v" => '', "\f" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => ''));
$this->next();
$return = $this->val();
$result = empty($type) ? $return : $this->object_to_array($return);
return addslashes_deep_obj($result);
}
示例3: decode
function decode($text,$type=0) // 默认type=0返回obj,type=1返回array
{
if (empty($text))
{
return '';
}
elseif (!is_string($text))
{
return false;
}
if (EC_CHARSET === 'utf-8' && function_exists('json_decode'))
{
return addslashes_deep_obj(json_decode(stripslashes($text),$type));
}
$this->at = 0;
$this->ch = '';
$this->text = strtr(stripslashes($text), array(
"\r" => '', "\n" => '', "\t" => '', "\b" => '',
"\x00" => '', "\x01" => '', "\x02" => '', "\x03" => '',
"\x04" => '', "\x05" => '', "\x06" => '', "\x07" => '',
"\x08" => '', "\x0b" => '', "\x0c" => '', "\x0e" => '',
"\x0f" => '', "\x10" => '', "\x11" => '', "\x12" => '',
"\x13" => '', "\x14" => '', "\x15" => '', "\x16" => '',
"\x17" => '', "\x18" => '', "\x19" => '', "\x1a" => '',
"\x1b" => '', "\x1c" => '', "\x1d" => '', "\x1e" => '',
"\x1f" => ''
));
$this->next();
$return = $this->val();
$result = empty($type) ? $return : $this->object_to_array($return);
return addslashes_deep_obj($result);
}
示例4: addslashes_deep_obj
/**
* 将对象成员变量或者数组的特殊字符进行转义
*
* @access public
* @param mix $obj 对象或者数组
* @author Xuan Yan
*
* @return mix 对象或者数组
*/
function addslashes_deep_obj($obj)
{
if (is_object($obj) == true) {
foreach ($obj as $key => $val) {
if ($val == true) {
$obj->{$key} = addslashes_deep_obj($val);
} else {
$obj->{$key} = addslashes_deep($val);
}
}
} else {
$obj = addslashes_deep($obj);
}
return $obj;
}
示例5: decode
function decode($text, $type = 0)
{
if (empty($text)) {
return '';
} elseif (!is_string($text)) {
return false;
}
if (function_exists('json_decode')) {
return addslashes_deep_obj(json_decode(stripslashes($text), $type));
}
$this->at = 0;
$this->ch = '';
$this->text = strtr(stripslashes($text), array("\r" => '', "\n" => '', "\t" => '', "\\b" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "\v" => '', "\f" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => '', "" => ''));
$this->next();
$return = $this->val();
if (empty($type)) {
$result = $return;
} else {
$result = $this->rec_get_object_vars($return);
//print_r($result);
}
return addslashes_deep_obj($result);
}