PHP with JSON

A common use of JSON is to read data from a web server, and display the data in a web page. This chapter will teach you how to exchange JSON data between the client and a PHP server.


$myObj->name = "MFAZIZ";
$myObj->age = 25;
$myObj->city = "Samsun";

$myJSON = json_encode($myObj);

echo $myJSON;

Leave a Reply

Your email address will not be published. Required fields are marked *