<?php header('Content-Type: application/json'); if (file_exists('xxx.json')) { $jsonData = file_get_contents('xxx.json'); $data = json_decode($jsonData, true); echo json_encode(['status' => 'success', 'data' => $data]); } else { echo json_encode(['status' => 'error', 'message' => 'File not found']); } ?>