Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header('Content-Type: application/json');
- $nazwy = ["Sypialnia","Kominek","Kuchnia","Graciarnia"];
- for ($p=0;$p<=sizeof($nazwy)-1;$p++)
- {
- $fuck['Temperatures'][$p]['Name']=$nazwy[$p];
- $nrCzujnika=$p+1;
- $temp = exec("/usr/bin/get_temp". $nrCzujnika .".sh");
- $fuck['Temperatures'][$p]['Value']=number_format($temp,1,',','');
- }
- echo json_encode($fuck, JSON_PRETTY_PRINT);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment