Answers for "return data as json php"

PHP
5

php return json

header('Content-type: application/json');
echo json_encode($array);
Posted by: Guest on March-20-2020
2

access json with php

<?php

$data = '{
	"name": "Aragorn",
	"race": "Human"
}';

$character = json_decode($data);
echo $character->name;
Posted by: Guest on August-20-2020

Browse Popular Code Answers by Language