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


PHP addslashes_deep_obj函数代码示例

本文整理汇总了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));
 }
开发者ID:az0ne,项目名称:simple_zoomeye,代码行数:9,代码来源:json.class.php

示例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);
 }
开发者ID:BGCX262,项目名称:zuyii-svn-to-git,代码行数:18,代码来源:cls_json.php

示例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);
    }
开发者ID:noikiy,项目名称:mdwp,代码行数:37,代码来源:cls_json.php

示例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;
}
开发者ID:BGCX261,项目名称:zhou3liu-svn-to-git,代码行数:24,代码来源:ecmall.php

示例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);
 }
开发者ID:thezawad,项目名称:xjoj,代码行数:23,代码来源:cls_json.php


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