JSON 常量详情参考 (内含对中文不转义的参数)
JSON_ERROR_NONE (integer)
没有错误发生。自 PHP 5.3.0 起生效。
JSON_ERROR_DEPTH (integer)
到达了最大堆栈深度。自 PHP 5.3.0 起生效。
JSON_ERROR_STATE_MISMATCH (integer)
出现了下溢(underflow)或者模式不匹配。自 PHP 5.3.0 起生效。
JSON_ERROR_CTRL_CHAR (integer)
控制字符错误,可能是编码不对。自 PHP 5.3.0 起生效。
JSON_ERROR_SYNTAX (integer)
语法错误。 自 PHP 5.3.0 起生效。
JSON_ERROR_UTF8 (integer)
异常的 UTF-8 字符,也许是因为不正确的编码。 自 PHP 5.3.3 起生效。
JSON_ERROR_RECURSION (integer)
The object or array passed to json_encode() include recursive references and cannot be encoded. If the JSON_PARTIAL_OUTPUT_ON_ERROR option was given, NULL will be encoded in the place of the recursive reference. Available since PHP 5.5.0.
JSON_ERROR_INF_OR_NAN (integer)
The value passed to json_encode() includes either NAN or INF. If the JSON_PARTIAL_OUTPUT_ON_ERROR option was given, 0 will be encoded in the place of these special numbers. Available since PHP 5.5.0.
JSON_ERROR_UNSUPPORTED_TYPE (integer)
A value of an unsupported type was given to json_encode(), such as a resource. If the JSON_PARTIAL_OUTPUT_ON_ERROR option was given, NULL will be encoded in the place of the unsupported value. Available since PHP 5.5.0.
JSON_ERROR_INVALID_PROPERTY_NAME (integer)
A key starting with \u0000 character was in the string passed to json_decode() when decoding a JSON object into a PHP object. Available since PHP 7.0.0.
JSON_ERROR_UTF16 (integer)
Single unpaired UTF-16 surrogate in unicode escape contained in the JSON string passed to json_encode(). Available since PHP 7.0.0.
下面的常量可以和 json_decode() 的 form 选项结合使用。 JSON_BIGINT_AS_STRING (integer)
将大数字编码成原始字符原来的值。 自 PHP 5.4.0 起生效。
JSON_OBJECT_AS_ARRAY (integer)
Decodes JSON objects as PHP array. This option can be added automatically by calling json_decode() with the second parameter equal to TRUE. Available since PHP 5.4.0.
下面的常量可以和 json_encode() 的 form 选项结合使用。 JSON_HEX_TAG (integer)
所有的 < 和 > 转换成 \u003C 和 \u003E。 自 PHP 5.3.0 起生效。
JSON_HEX_AMP (integer)
所有的 & 转换成 \u0026。 自 PHP 5.3.0 起生效。
JSON_HEX_APOS (integer)
所有的 ' 转换成 \u0027。 自 PHP 5.3.0 起生效。
JSON_HEX_QUOT (integer)
所有的 " 转换成 \u0022。 自 PHP 5.3.0 起生效。
JSON_FORCE_OBJECT (integer)
使一个非关联数组输出一个类(Object)而非数组。 在数组为空而接受者需要一个类(Object)的时候尤其有用。 自 PHP 5.3.0 起生效。
JSON_NUMERIC_CHECK (integer)
将所有数字字符串编码成数字(numbers)。 自 PHP 5.3.3 起生效。
JSON_PRETTY_PRINT (integer)
用空白字符格式化返回的数据。 自 PHP 5.4.0 起生效。
JSON_UNESCAPED_SLASHES (integer)
不要编码 /。 自 PHP 5.4.0 起生效。
JSON_UNESCAPED_UNICODE (integer)
以字面编码多字节 Unicode 字符(默认是编码成 \uXXXX)。 自 PHP 5.4.0 起生效。
JSON_PARTIAL_OUTPUT_ON_ERROR (integer)
Substitute some unencodable values instead of failing. Available since PHP 5.5.0.
JSON_PRESERVE_ZERO_FRACTION (integer)
Ensures that float values are always encoded as a float value. Available since PHP 5.6.6.
JSON_UNESCAPED_LINE_TERMINATORS (integer)
The line terminators are kept unescaped when JSON_UNESCAPED_UNICODE is supplied. It uses the same behaviour as it was before PHP 7.1 without this constant. Available since PHP 7.1.0.
JSON 常量详情参考 (内含对中文不转义的参数)的更多相关文章
- 放弃"指针常量"这种不严谨的中文描述!深度理解数组名、指针常量
ques1: 数组名完全等价于指针常量吗? int array[10] = { 10,11,12,13,14,15 }; printf("sizeof(array)= %d \n" ...
- 试用 ModVB(一):安装教程+使用 JSON 常量和 JSON 模式匹配
前排提醒:阅读此文章并充分尝试 ModVB 的新语法需要较长的时间.对于程序员而言,如果你工作时不用 VB,则最好避免在上班时间看,以免被领导认为你在长时间摸鱼. 什么是 ModVB ModVB 是一 ...
- Python+requests r.json()获取的内容,控制台显示中文Unicode转为utf-8《九》
在接口测试中,直接使用r.json()获取到的结果,难免会在结果中带有中文,但是在控制台的中文输出默认是Unicode编码,不能通过统一在设置中进行设置utf-8,因此为了在控制台更显而易见的显示出中 ...
- JQuery和JSON方式参数传递并处理JAVAWEB中文乱码问题
本文主要讲springMVC中视图和控制器之间常用的两种传递参数的方式: 1.JQuery 2.JSON 一.JQuery方式 思路:单击按钮后,触发JQuery事件,而提交整个表单 JSP中 < ...
- 解决ASP.NET Web API Json对象循环参考错误
前言 一般我们在开法 ASP.NET Web API 时,如果是使用 Entity Framework 技术来操作数据库的话,当两个 Entity 之间包含导览属性(Navigation Proper ...
- ajax中url赋json格式的值时发生中文乱码的相关问题
具体流程:转入到jsp界面时会加载ajax,ajax转到url时传带hide在jsp界面的值titleString,其来源见下面的代码. String title=new String("\ ...
- 让Jackson JSON生成的数据包含的中文以unicode方式编码
本文出处:http://blog.csdn.net/chaijunkun/article/details/8257209,转载请注明.由于本人不定期会整理相关博文,会对相应内容作出完善.因此强烈建 ...
- json前后台传输,以及乱码中文问题探讨
背景介绍: 我现在的工作是做传统项目开发,没有用到框架.最近在做项目时,经常需要使用ajax从后台拿数据到前台,是json格式的.先说下我在项目中遇到的问题吧,前台拿到了数据,需要将其转化为对象,我使 ...
- 如何让Jackson JSON生成的数据包含的中文以unicode方式编码
我们都知道,Jackson JSON以高速.方便和灵活著称.之前的文章中介绍过使用注解的形式来规定如何将一个对象序列化成JSON的方法,以及如何将一个JSON数据反序列化到一个对象上.但是美中不足的一 ...
随机推荐
- SysPeek打不开解决方法
SysPeek 是Linux平台下一款简洁小巧的系统状态指示软件,可实时显示 CPU.Memory.Swap.硬盘和网络使用情况.然而最近却使用不了,打不开.无论点击图标或者是终端打开,都不显示.看错 ...
- P4088 [USACO18FEB]Slingshot 线段树+扫描线
\(\color{#0066ff}{ 题目描述 }\) Farmer John最讨厌的农活是运输牛粪.为了精简这个过程,他产生了一个新奇的想法:与其使用拖拉机拖着装满牛粪的大车从一个地点到另一个地点, ...
- USACO 1.3.6 Ski Course Design[滑雪课程设计]
先说说思路: 这题比上一道坑人的wormholes简单多了!我一看到这题,“XXX设计”,还以为要用到什么dp呢,没想到是水题 用两层循环,第一层循环相差17中的上界,第二层遍历所有的山峰计算答案.并 ...
- memcache_helper
class memcache_helper extends memcache { private $host = "127.0.0.1"; private $port = &quo ...
- Flashcache的 KEEP属性自动失效
如果希望一个数据对象长期地缓存在flashcache中,则可以手动地将该数据对象的CELL_FLASH_CACHE属性设置为"keep". 其实需要说明的是,但不是数据对象的CEL ...
- visual studio 2013 error: Page '312e8a59-2712-48a1-863e-0ef4e67961fc' not found.
In order to resolve this error do the following : Open Developer Command Prompt for VS 2013 as “Run ...
- CodeForces - 476B -Dreamoon and WiFi(DFS+概率思维)
Dreamoon is standing at the position 0 on a number line. Drazil is sending a list of commands throug ...
- bootstrap多选框
不多说,先上图片 本多选框是用的bootstrap的样式为基础,将弹出框css改造,然后自己写的js得到. 下面为全部页面的代码,需要的可以自己改动js,得到自己需要的效果 <!DOCTYPE ...
- oracle Clob类型转换成String类型
转载:https://www.cnblogs.com/itmyhome/p/4131339.html Clob类型转换成String类型 oracle中表结构如下: create table GRID ...
- Subarray Sum K
Given an nonnegative integer array, find a subarray where the sum of numbers is k. Your code should ...