Store array to file as JSON String

The accepted answer to this StackOverflow question shows how to save multiple json strings to a text file.