• <legend id='ZwpxV'><style id='ZwpxV'><dir id='ZwpxV'><q id='ZwpxV'></q></dir></style></legend>

    <small id='ZwpxV'></small><noframes id='ZwpxV'>

      <tfoot id='ZwpxV'></tfoot>
    1. <i id='ZwpxV'><tr id='ZwpxV'><dt id='ZwpxV'><q id='ZwpxV'><span id='ZwpxV'><b id='ZwpxV'><form id='ZwpxV'><ins id='ZwpxV'></ins><ul id='ZwpxV'></ul><sub id='ZwpxV'></sub></form><legend id='ZwpxV'></legend><bdo id='ZwpxV'><pre id='ZwpxV'><center id='ZwpxV'></center></pre></bdo></b><th id='ZwpxV'></th></span></q></dt></tr></i><div id='ZwpxV'><tfoot id='ZwpxV'></tfoot><dl id='ZwpxV'><fieldset id='ZwpxV'></fieldset></dl></div>

      • <bdo id='ZwpxV'></bdo><ul id='ZwpxV'></ul>

      1. 当我们有 json_encode 时为什么要使用 CJSON 编码

        Why use CJSON encode when we have json_encode(当我们有 json_encode 时为什么要使用 CJSON 编码)
      2. <small id='z6Ipb'></small><noframes id='z6Ipb'>

          • <tfoot id='z6Ipb'></tfoot>
            • <bdo id='z6Ipb'></bdo><ul id='z6Ipb'></ul>
              <i id='z6Ipb'><tr id='z6Ipb'><dt id='z6Ipb'><q id='z6Ipb'><span id='z6Ipb'><b id='z6Ipb'><form id='z6Ipb'><ins id='z6Ipb'></ins><ul id='z6Ipb'></ul><sub id='z6Ipb'></sub></form><legend id='z6Ipb'></legend><bdo id='z6Ipb'><pre id='z6Ipb'><center id='z6Ipb'></center></pre></bdo></b><th id='z6Ipb'></th></span></q></dt></tr></i><div id='z6Ipb'><tfoot id='z6Ipb'></tfoot><dl id='z6Ipb'><fieldset id='z6Ipb'></fieldset></dl></div>

              <legend id='z6Ipb'><style id='z6Ipb'><dir id='z6Ipb'><q id='z6Ipb'></q></dir></style></legend>

                    <tbody id='z6Ipb'></tbody>
                  本文介绍了当我们有 json_encode 时为什么要使用 CJSON 编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用 Yii 为网站构建 API.我知道有一个名为 CJson 的实用程序类,并且有一个名为 encode 的函数.

                  I am building an API for a website using Yii. I know that there is a utility class called CJson and has a function called encode.

                  据我所知,还有一些额外的参数可以在原生 json_encode 函数中进行自定义,比如 JSON_NUMERIC_CHECK,这非常有用.它创造了

                  As far as I know there are additional parameters that can be customized in the native json_encode function like the JSON_NUMERIC_CHECK which is really useful. It creates

                  {
                      "id": 17
                  }
                  

                  而不是 Yii 的 CJSON 编码,它使 '17' 成为一个字符串.

                  instead of Yii's CJSON encode which makes the '17' a string.

                  {
                      "id": "17"
                  }
                  

                  所以我的问题是是否有任何理由我应该使用 CJSON 编码而不是内置的 PHP 函数 json_encode ?

                  So my question is whether there is any reason I should use CJSON encode instead of the built in PHP function json_encode ?

                  推荐答案

                  我能想到的只有最低 php 版本支持.

                  Only thing I can think minimum php version support.

                  Yii 支持 php 5.1 作为最低版本,请参阅 Yii 安装页面.而 json_encode/json_decode 在 php 5.2 中引入.所以这可能是 Yii 拥有 CJson 库的一个原因.

                  Yii support php 5.1 as minimum version See Yii Installation Page . While json_encode/json_decode introduced in php 5.2. So It can be a reason for Yii having a library for CJson.

                  这篇关于当我们有 json_encode 时为什么要使用 CJSON 编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Is PHP or PHP based web framework stateful or stateless?(PHP 或基于 PHP 的 Web 框架是有状态的还是无状态的?)
                  How to parse django style template tags(如何解析 django 样式模板标签)
                  What is a good setup for editing PHP in Emacs?(在 Emacs 中编辑 PHP 的好设置是什么?)
                  How to check whether specified PID is currently running without invoking ps from PHP?(如何在不从 PHP 调用 ps 的情况下检查指定的 PID 当前是否正在运行?)
                  What#39;s the difference between escapeshellarg and escapeshellcmd?(escapeshellarg 和escapeshellcmd 有什么区别?)
                  php in background exec() function(php 后台 exec() 函数)
                  <legend id='uOKsY'><style id='uOKsY'><dir id='uOKsY'><q id='uOKsY'></q></dir></style></legend>

                    <tfoot id='uOKsY'></tfoot>

                  • <small id='uOKsY'></small><noframes id='uOKsY'>

                      <tbody id='uOKsY'></tbody>
                      <bdo id='uOKsY'></bdo><ul id='uOKsY'></ul>

                      <i id='uOKsY'><tr id='uOKsY'><dt id='uOKsY'><q id='uOKsY'><span id='uOKsY'><b id='uOKsY'><form id='uOKsY'><ins id='uOKsY'></ins><ul id='uOKsY'></ul><sub id='uOKsY'></sub></form><legend id='uOKsY'></legend><bdo id='uOKsY'><pre id='uOKsY'><center id='uOKsY'></center></pre></bdo></b><th id='uOKsY'></th></span></q></dt></tr></i><div id='uOKsY'><tfoot id='uOKsY'></tfoot><dl id='uOKsY'><fieldset id='uOKsY'></fieldset></dl></div>