You are here: Home » PHP » JSON web service

JSON web service

26 Flares 26 Flares ×

To display data in json for web service, first create database connection.
Select data from database and store data in a associative array, here i am store data in $row[].
Call header(‘Content-type: application/json’); for print data in JSON.
Print data with json_encode.

$rows));

?>

About Abhishek Sinha

I am Abhishek and I love to code on PHP.

Leave a Reply

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

*

Scroll To Top
26 Flares Twitter 2 Facebook 3 Google+ 18 StumbleUpon 1 Pin It Share 0 LinkedIn 2 26 Flares ×