File tree Expand file tree Collapse file tree
user_guide_src/source/incoming Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -182,14 +182,13 @@ The second and third parameters match up to the ``$depth`` and ``$flags`` argume
182182Getting Specific Data from JSON
183183===============================
184184
185- You can get a specific piece of data from a JSON stream by passing a variable name into ``getVar () `` for the
185+ You can get a specific piece of data from a JSON stream by passing a variable name into ``getJsonVar () `` for the
186186data that you want or you can use "dot" notation to dig into the JSON to get data that is not on the root level.
187187
188188.. literalinclude :: incomingrequest/010.php
189189
190- If you want the result to be an associative array instead of an object, you can use ``getJsonVar() `` instead and pass
191- true in the second parameter. This function can also be used if you can't guarantee that the incoming request will have the
192- correct ``Content-Type `` header.
190+ If you want the result to be an associative array instead of an object, you can
191+ pass true in the second parameter:
193192
194193.. literalinclude :: incomingrequest/011.php
195194
Original file line number Diff line number Diff line change 1010 * }
1111 */
1212
13- $ data = $ request ->getVar ('foo ' );
13+ $ data = $ request ->getJsonVar ('foo ' );
1414// $data = "bar"
1515
16- $ data = $ request ->getVar ('fizz.buzz ' );
16+ $ data = $ request ->getJsonVar ('fizz.buzz ' );
1717// $data = "baz"
You can’t perform that action at this time.
0 commit comments