reference/json/functions/json-encode.xml
19e8122137a1d42ed60f17fe2c0c2b69b0b2d16b
...
...
@@ -16,7 +16,13 @@
16
16
</methodsynopsis>
17
17
<para>
18
18
Returns a string containing the JSON representation of the supplied
19
-
<parameter>value</parameter>.
19
+
<parameter>value</parameter>. If the parameter is an &array; or &object;,
20
+
it will be serialized recursively.
21
+
</para>
22
+
<para>
23
+
If a value to be serialized is an object, then by default only publicly visible
24
+
properties will be included. Alternatively, a class may implement <interfacename>JsonSerializable</interfacename>
25
+
to control how its values are serialized to <acronym>JSON</acronym>.
20
26
</para>
21
27
<para>
22
28
The encoding is affected by the supplied <parameter>flags</parameter>
...
...
@@ -125,7 +131,7 @@
125
131
<entry>
126
132
<link linkend="ini.serialize-precision">serialize_precision</link> is
127
133
used instead of <link linkend="ini.precision">precision</link> when
128
-
encoding double values.
134
+
encoding <type>float</type> values.
129
135
</entry>
130
136
</row>
131
137
</tbody>
...
...
@@ -158,7 +164,7 @@ echo json_encode($arr);
158
164

159
165
<example>
160
166
<title>
161
-
A <function>json_encode</function> example showing some options in use
167
+
A <function>json_encode</function> example showing some flags in use
162
168
</title>
163
169
<programlisting role="php">
164
170
<![CDATA[
165
171