Answers for "json encode and decode file txt in php"

PHP
8

php decode json file

$json = json_decode(file_get_contents('/path/to/your/file.json'));
Posted by: Guest on March-15-2020
0

json encode decode php

$json = '{"a":1,"b":2,"c":3}';
var_dump(json_decode($json)); //converts json to array

$array = [ "a" => 1, "b" => 2, "c" => 3];
echo json_encode($json_encode($json)); //converts array to json
Posted by: Guest on April-07-2022

Code answers related to "json encode and decode file txt in php"

Browse Popular Code Answers by Language