• Как распарсить json идущий друг за другом со вложенностью?

    @Giperoglif
    $str = '{"param1": "value1","param1": "value1","param1": "value1","param1": {},"param1": "value1"}{"param1": "value1","param1": "value1","param1": "value1","param1": {},"param1": "value1"}{"param1": "value1","param1": "value1","param1": "value1","param1": {},"param1": "value1"}';
    $arr = explode('}{', $str);
    print_r($arr);
    
    Array
    (
    [0] => {"param1": "value1","param1": "value1","param1": "value1","param1": {},"param1": "value1"
    [1] => "param1": "value1","param1": "value1","param1": "value1","param1": {},"param1": "value1"
    [2] => "param1": "value1","param1": "value1","param1": "value1","param1": {},"param1": "value1"}
    )


    +немного допилить напильником каждый элемент массива до нормальной json-строки и дальше как обычно

    изврат, конечно
    Ответ написан
    1 комментарий