Writing JSON7:52 with Alena Holligan
The ease of working with JSON is one of the main reasons it has become such a popular format for sharing data on the web. We can take any object or array from PHP and turn it into JSON that can then be shared without needing to rely on a particular language.
JSON Encoding Options
In this video, we show the use of JSON_PRETTY_PRINT and JSON_UNESCAPED_SLASHES. Other options that are available include: JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_FORCE_OBJECT, JSON_PRESERVE_ZERO_FRACTION, JSON_UNESCAPED_UNICODE, JSON_PARTIAL_OUTPUT_ON_ERROR.
Validating & Formatting JSON
The JSON Formatter was created to help with debugging JSON. As JSON data is often output without line breaks to save space, it is extremely difficult to actually read and make sense of it. This little tool attemps to solve the problem by formatting the JSON data so that it is easy to read and debug by human beings.
You need to sign up for Treehouse in order to download course files.Sign up