D
D
Denis2016-06-16 17:55:40
PHP
Denis, 2016-06-16 17:55:40

JSON nesting depth, how to get around limit?

I build a binary tree, a parent and 2 branches, and so on. With d3.js.
I ran into a problem that when an object with a large nesting is obtained, the json_encode function falls off on JSON_ERROR_DEPTH - "Maximum stack depth exceeded"
I can't figure out how to get around this. I understand that most likely you need to break such json. But is there an option for an hour that will allow you to increase the nesting? In general, you need to get around this in order to build very long trees, for thousands of investments.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
aol-nnov, 2016-06-16
@gccDenys

string json_encode ( mixed $value [, int $options = 0 [, int $depth = 512 ]] )

G
Greg Popov, 2016-06-16
@Gregpopov

Here is one of about 16,000 search results

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question