There is a two-level array encoded in json :

 Array ( [1] => 28 [2] => 185 [3] => 70 [4] => 3 [5] => Array ( [1] => fgvbz [2] => xzcvzxcbxcb [3] => vcbcxbcvb ) [6] => male [7] => true ) 

How to leave a json in an array format? An error occurs with the depth parameter if you specify less than 3

    1 answer 1

    According to the documentation

    depth Indicates the depth of the recursion.

    This parameter has been entered to protect against memory overflow. You have an object that contains three levels of nesting, therefore you cannot have a depth parameter less than three. By default it is 512.

    • Those. Should I encode this element separately back into json ? - Leo240
    • @ Leo240 why? You do not know what you can be nesting elements? - Anton Shchyrov
    • I just need to save in the json format for writing to the cell of the sql table this nested array, and scatter the elements of the parent array in other cells - Leo240
    • @ Leo240 You did not answer the previous question. Do you know what level of nesting can you have? - Anton Shchyrov
    • yes, only that already is - Leo240