norman2

Untitled

Apr 29th, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. <?php
  2.  
  3. header('Content-Type: application/json');
  4. $nazwy = ["Sypialnia","Kominek","Kuchnia","Graciarnia"];
  5. for ($p=0;$p<=sizeof($nazwy)-1;$p++)
  6.     {
  7.         $fuck['Temperatures'][$p]['Name']=$nazwy[$p];
  8.         $nrCzujnika=$p+1;
  9.         $temp = exec("/usr/bin/get_temp". $nrCzujnika .".sh");
  10.         $fuck['Temperatures'][$p]['Value']=number_format($temp,1,',','');
  11. }
  12.  
  13. echo json_encode($fuck, JSON_PRETTY_PRINT);
  14.  
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment