php5.1.6 case, the recursion appears. Find Break!!!
$m = Array (' 1 ');
$m [' a '] = $m;
Print_r ($m);
Die
?>
This is a simple test. The result of the output is
Array ([0] = 1 [a] = = array *recursion*)
But the result I want is:
Array ([0] = 1 [a] = = Array ([0] = 1))
Should we change that place? Ask the Great God for answers
Share to: more
------Solution--------------------
Recursion recursion
This is how Print_r displays results when recursion occurs.
That's right, because Print_r is just for debugging, meaning it's okay.
------Solution--------------------
Your PHP version is too low, json_encode error is normal
------Solution--------------------
php5.2.5 can't handle this situation.
Json_encode () [Function.json-encode]:
recursion detected
------Solution--------------------
My php Version 5.3.27 output is exactly the array ([0] = 1 [a] + = Array ([0] = 1))