Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $jsonstr = file_get_contents('../readings.json');
- if($jsonstr != false) {
- $json = json_decode($jsonstr, true);
- if($json == NULL) {
- // JSON Decode Error
- $jout = array('error'=>true);
- echo json_encode($jout);
- } else {
- $json["error"]=false;
- echo json_encode($json);
- }
- } else {
- // File Read Error
- $jout = array('error'=>true);
- echo json_encode($jout);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment