Reading JSON Data from a File in PHP


Read and decode JSON data from a file into a PHP array.

Source Code

$jsonData = file_get_contents('data.json');
$data = json_decode($jsonData, true);
print_r($data);
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments