Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Creating and Parsing JSON Data in PHP

DZone's Guide to

Creating and Parsing JSON Data in PHP

· ·
Free Resource

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.

 1,'name'=>'jackson','country'=>'usa','office'=>array('google','oracle')
);
echo json_encode
($json_data);

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

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}