This post will help you to make get API to return records using core PHP in JSON format.
Return A single record
<?php
header("Content-Type:application/json");
$response['roll'] = 101;
$response['name'] = "ram";
$response['city'] = "vns";
$json_response = json_encode($response);
echo $json_response;
?>
No comments:
Post a Comment