Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
An interface defines the public facing interaction of an item. It does not define any implementation details about the inner workings of those interactions. By implementing an interface, we agree to implement the methods described in the contract of the interface.
Course: File Handling with PHP - JSON
Documentation for JavaScript Object Notation
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.
The decoding in PHP 5 is handled by a parser based on the JSON_checker by Douglas Crockford. PHP 7 comes with a completely new and improved parser that is specifically written for PHP and licensed under the PHP license. Either version uses the following functions:
json_encode - Returns a string containing the JSON representation of the supplied value.
json_decode - Takes a JSON encoded string and converts it into a PHP variable.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up