DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Chara has posted 50 posts at DZone. View Full User Profile

Creating and Parsing JSON Data in PHP

  • submit to reddit
$json_data = array(
echo json_encode

// Result:
// {"id":1,"name":"jackson","country":"usa","office":["google","oracle"]}

This code demonstrates how to create and parse the JSON data format of using array of PHP. It's a very simple code, that allows you to perform this task.