Answers for "php to json output"

PHP
5

php echo json

<?php
$data = ['name' => 'John', 'age' => 35];
header('Content-type: Application/json');
echo json_encode($data);
Posted by: Guest on September-25-2020
2

parse json phph

echo json_decode("[1,2,3]")[0];
Posted by: Guest on January-15-2020

Browse Popular Code Answers by Language