警告:json_decode()最多需要2个参数,4个给定

时间:2012-05-09 02:02:34

标签: php json

我试着像这样使用json_decode:

json_decode($string, true, 100, JSON_BIGINT_AS_STRING);

但是我收到了错误:

Warning: json_decode() expects at most 2 parameters, 4 given in /home/content/27/2326027/html/sys/get.php on line 38

任何回复都是适用的

1 个答案:

答案 0 :(得分:19)

好像你的PHP版本不支持这些参数。

见手册:

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. 

要使用您编写的代码,您应该至少需要5.4.0版本...