sunders/www/sunders/decode-json.php
2024-09-12 19:22:07 +00:00

10 lines
261 B
PHP

<?php
// Convert the content of a JSON file to a PHP array.
function getDecodedJSON($jsonPath) {
$handle = fopen($jsonPath, 'r');
$jsonContent = fread($handle, filesize($jsonPath));
fclose($handle);
return json_decode($jsonContent);
}
?>