
Ifeoluwa A. answered 05/18/19
Tutor
4.9
(36)
Certified IT Consultant
You can use json_encode to return JSON format of your result.
For example
$arr = array("name" => array("John", "Doe"));
echo json_encode($arr);
this will return json format {"name":["John","Doe"]}