Can an array be top-level JSON-text?

Viewed 73988
6 Answers

This works for me:

["apple","pear","banana"]

I store that above in MySQL DB as a string, and then have no problem doing this in my PHP:

  <?php

        $checkArr = json_decode($pageData[0]['pg_json']);

        echo $checkArr[0];

    ?>

Which yields this:

apple

Related