Warning: json_decode() expects at most 2 parameters, 4 given

json, php

Solution

Seems like your PHP version doesn't support those parameters.

See manual:

Version     Description
5.4.0   The options parameter was added.
5.3.0   Added the optional depth. The default recursion depth was increased from 128 to 512
5.2.3   The nesting limit was increased from 20 to 128
5.2.1   Added support for JSON decoding of basic types. 

To use the code you written, you should need atleast 5.4.0 version...

Problem

I tried to use json_decode like this: ``` json_decode($string, true, 100, JSON_BIGINT_AS_STRING); ``` but i got the error: ``` Warning: json_decode() expects at most 2 parameters, 4 given in /home/content/27/2326027/html/sys/get.php on line 38 ``` any response would be apprecaite

Original source