Answers for "create function in php to get data from json"

PHP
1

php return json data

header('Content-Type: application/json'); 

$colors = array("red","blue","green");
echo json_encode($colors);
Posted by: Guest on October-30-2019
-1

Returning JSON from a PHP Script

<?php
$data = /** whatever you're serializing **/;
header('Content-Type: application/json; charset=utf-8');
echo json_encode($data);
Posted by: Guest on November-18-2021

Code answers related to "create function in php to get data from json"

Browse Popular Code Answers by Language