😁PHP JSON full (ok)

https://zetcode.com/php/json/

PHP JSON encode

C:\xampp\htdocs\abc\encode.php

<?php
$data = ["falcon", "sky", "cloud", "orange", "wood", "forest"];
header('Content-type:application/json;charset=utf-8');
echo json_encode($data);

PHP JSON decode

C:\xampp\htdocs\abc\decode.php

We start the server.

PHP JSON read from file

C:\xampp\htdocs\abc\data.json

PHP JSON and JS fetch API

C:\xampp\htdocs\abc\index.php

Last updated

Was this helpful?