News for hackers. Stuff that matters.
Re:JSON River – Parse JSON incrementally as it streams in by zeroimpl on Monday October 13, 2025 @10:26PM (#45575615)
I couldn’t find a library like this in PHP, but realized for my use case I could easily hack something together. Algorithm is simply:

- trim off all trailing delimiters: },"

- then add on a fixed suffix: "]}

- then try parsing as a standard json. Ignore results if fails to parse.

This works since the schema I’m parsing had a fairly simple structure where everything of interest was at a specific depth in the hierarchy and values were all strings.

There are no comments on this comment yet.