Answers for "php access json data header"

PHP
1

php header json

header('Content-Type: application/json');
echo json_encode($data);
Posted by: Guest on March-03-2021
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