2007-12-23 20:45:22 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2009-07-11 07:50:41 +00:00
|
|
|
<!-- $Revision$ -->
|
2007-12-23 20:45:22 +00:00
|
|
|
|
|
|
|
<appendix xml:id="json.constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
|
|
&reftitle.constants;
|
2008-12-19 07:52:29 +00:00
|
|
|
&extension.constants;
|
|
|
|
<para>
|
2008-12-24 15:01:09 +00:00
|
|
|
The following constants indicate the type of error returned by
|
2012-01-09 11:30:17 +00:00
|
|
|
<function>json_last_error</function>.
|
2008-12-19 07:52:29 +00:00
|
|
|
</para>
|
|
|
|
<variablelist>
|
2012-02-28 13:22:09 +00:00
|
|
|
<varlistentry xml:id="constant.json-error-none">
|
2008-12-19 07:52:29 +00:00
|
|
|
<term>
|
|
|
|
<constant>JSON_ERROR_NONE</constant>
|
|
|
|
(<type>integer</type>)
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
2008-12-24 15:01:09 +00:00
|
|
|
No error has occurred.
|
2012-01-09 11:30:17 +00:00
|
|
|
Available since PHP 5.3.0.
|
2008-12-19 07:52:29 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2012-02-28 13:22:09 +00:00
|
|
|
<varlistentry xml:id="constant.json-error-depth">
|
2008-12-19 07:52:29 +00:00
|
|
|
<term>
|
|
|
|
<constant>JSON_ERROR_DEPTH</constant>
|
|
|
|
(<type>integer</type>)
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
2008-12-24 15:01:09 +00:00
|
|
|
The maximum stack depth has been exceeded.
|
2012-01-09 11:30:17 +00:00
|
|
|
Available since PHP 5.3.0.
|
2008-12-19 07:52:29 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2012-02-28 13:22:09 +00:00
|
|
|
<varlistentry xml:id="constant.json-error-state-mismatch">
|
2011-06-16 12:55:11 +00:00
|
|
|
<term>
|
|
|
|
<constant>JSON_ERROR_STATE_MISMATCH</constant>
|
|
|
|
(<type>integer</type>)
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
|
|
|
Occurs with underflow or with the modes mismatch.
|
2012-01-09 11:30:17 +00:00
|
|
|
Available since PHP 5.3.0.
|
2011-06-16 12:55:11 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2012-02-28 13:22:09 +00:00
|
|
|
<varlistentry xml:id="constant.json-error-ctrl-char">
|
2008-12-19 07:52:29 +00:00
|
|
|
<term>
|
|
|
|
<constant>JSON_ERROR_CTRL_CHAR</constant>
|
|
|
|
(<type>integer</type>)
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
2008-12-24 15:01:09 +00:00
|
|
|
Control character error, possibly incorrectly encoded.
|
2012-01-09 11:30:17 +00:00
|
|
|
Available since PHP 5.3.0.
|
2008-12-19 07:52:29 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2012-02-28 13:22:09 +00:00
|
|
|
<varlistentry xml:id="constant.json-error-syntax">
|
2008-12-19 07:52:29 +00:00
|
|
|
<term>
|
|
|
|
<constant>JSON_ERROR_SYNTAX</constant>
|
|
|
|
(<type>integer</type>)
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
|
|
|
Syntax error.
|
2012-01-09 11:30:17 +00:00
|
|
|
Available since PHP 5.3.0.
|
2008-12-19 07:52:29 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2012-02-28 13:22:09 +00:00
|
|
|
<varlistentry xml:id="constant.json-error-utf8">
|
2010-03-18 17:15:03 +00:00
|
|
|
<term>
|
|
|
|
<constant>JSON_ERROR_UTF8</constant>
|
|
|
|
(<type>integer</type>)
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
|
|
|
Malformed UTF-8 characters, possibly incorrectly encoded. This
|
2012-11-21 13:11:15 +00:00
|
|
|
constant is available as of PHP 5.3.3.
|
2010-03-18 17:15:03 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2008-12-19 07:52:29 +00:00
|
|
|
</variablelist>
|
2009-03-19 15:42:54 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
The following constants can be combined to form options for
|
2012-01-09 11:30:17 +00:00
|
|
|
<function>json_encode</function>.
|
2009-03-19 15:42:54 +00:00
|
|
|
</para>
|
|
|
|
<variablelist>
|
2012-02-28 13:22:09 +00:00
|
|
|
<varlistentry xml:id="constant.json-hex-tag">
|
2009-03-19 15:42:54 +00:00
|
|
|
<term>
|
|
|
|
<constant>JSON_HEX_TAG</constant>
|
|
|
|
(<type>integer</type>)
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
|
|
|
All < and > are converted to \u003C and \u003E.
|
2012-01-09 11:30:17 +00:00
|
|
|
Available since PHP 5.3.0.
|
2009-03-19 15:42:54 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2012-02-28 13:22:09 +00:00
|
|
|
<varlistentry xml:id="constant.json-hex-amp">
|
2009-03-19 15:42:54 +00:00
|
|
|
<term>
|
|
|
|
<constant>JSON_HEX_AMP</constant>
|
|
|
|
(<type>integer</type>)
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
|
|
|
All &s are converted to \u0026.
|
2012-01-09 11:30:17 +00:00
|
|
|
Available since PHP 5.3.0.
|
2009-03-19 15:42:54 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2012-02-28 13:22:09 +00:00
|
|
|
<varlistentry xml:id="constant.json-hex-apos">
|
2009-03-19 15:42:54 +00:00
|
|
|
<term>
|
|
|
|
<constant>JSON_HEX_APOS</constant>
|
|
|
|
(<type>integer</type>)
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
|
|
|
All ' are converted to \u0027.
|
2012-01-09 11:30:17 +00:00
|
|
|
Available since PHP 5.3.0.
|
2009-03-19 15:42:54 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2012-02-28 13:22:09 +00:00
|
|
|
<varlistentry xml:id="constant.json-hex-quot">
|
2009-03-19 15:42:54 +00:00
|
|
|
<term>
|
|
|
|
<constant>JSON_HEX_QUOT</constant>
|
|
|
|
(<type>integer</type>)
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
|
|
|
All " are converted to \u0022.
|
2012-01-09 11:30:17 +00:00
|
|
|
Available since PHP 5.3.0.
|
2009-03-19 15:42:54 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2012-02-28 13:22:09 +00:00
|
|
|
<varlistentry xml:id="constant.json-force-object">
|
2009-03-19 15:42:54 +00:00
|
|
|
<term>
|
|
|
|
<constant>JSON_FORCE_OBJECT</constant>
|
|
|
|
(<type>integer</type>)
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
|
|
|
Outputs an object rather than an array when a non-associative array is
|
|
|
|
used. Especially useful when the recipient of the output is expecting
|
|
|
|
an object and the array is empty.
|
2012-01-09 11:30:17 +00:00
|
|
|
Available since PHP 5.3.0.
|
2009-03-19 15:42:54 +00:00
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2012-02-28 13:22:09 +00:00
|
|
|
<varlistentry xml:id="constant.json-numeric-check">
|
2011-06-16 12:55:11 +00:00
|
|
|
<term>
|
|
|
|
<constant>JSON_NUMERIC_CHECK</constant>
|
|
|
|
(<type>integer</type>)
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
|
|
|
Encodes numeric strings as numbers.
|
|
|
|
Available since PHP 5.3.3.
|
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2012-02-28 13:22:09 +00:00
|
|
|
<varlistentry xml:id="constant.json-bigint-as-string">
|
2011-06-30 13:40:55 +00:00
|
|
|
<term>
|
|
|
|
<constant>JSON_BIGINT_AS_STRING</constant>
|
|
|
|
(<type>integer</type>)
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
2012-01-09 11:30:17 +00:00
|
|
|
Encodes large integers as their original string value.
|
2011-06-30 13:40:55 +00:00
|
|
|
Available since PHP 5.4.0.
|
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2012-02-28 13:22:09 +00:00
|
|
|
<varlistentry xml:id="constant.json-pretty-print">
|
2011-06-30 14:02:46 +00:00
|
|
|
<term>
|
|
|
|
<constant>JSON_PRETTY_PRINT</constant>
|
|
|
|
(<type>integer</type>)
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
|
|
|
Use whitespace in returned data to format it.
|
|
|
|
Available since PHP 5.4.0.
|
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2012-02-28 13:22:09 +00:00
|
|
|
<varlistentry xml:id="constant.json-unescaped-slashes">
|
2011-06-30 14:02:46 +00:00
|
|
|
<term>
|
|
|
|
<constant>JSON_UNESCAPED_SLASHES</constant>
|
|
|
|
(<type>integer</type>)
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
|
|
|
Don't escape <literal>/</literal>.
|
|
|
|
Available since PHP 5.4.0.
|
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2012-02-28 13:22:09 +00:00
|
|
|
<varlistentry xml:id="constant.json-unescaped-unicode">
|
2011-08-29 16:22:02 +00:00
|
|
|
<term>
|
|
|
|
<constant>JSON_UNESCAPED_UNICODE</constant>
|
|
|
|
(<type>integer</type>)
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<simpara>
|
|
|
|
Encode multibyte Unicode characters literally (default is to escape as \uXXXX).
|
|
|
|
Available since PHP 5.4.0.
|
|
|
|
</simpara>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2009-03-19 15:42:54 +00:00
|
|
|
</variablelist>
|
2007-12-23 20:45:22 +00:00
|
|
|
</appendix>
|
2008-12-24 15:01:09 +00:00
|
|
|
|
2007-12-23 20:45:22 +00:00
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2007-12-23 20:45:22 +00:00
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|
|
|
|
|