Posted By

orenus on 06/30/10


Tagged

php oop getweather Lesson2


Versions (?)

Get Weather - Step 3 - Class


 / Published in: PHP
 

  1. class WeatherService{
  2.  
  3. public function WeatherService(){
  4. //some initialization...
  5. }
  6.  
  7. public function getWeatherInfo($city){
  8.  
  9. $res = shell_exec("./getWdr.sh {$city}");
  10.  
  11. return $res;
  12. }
  13.  
  14. public function convertFrToC($val){
  15. return (($val+40)*5/9)-40;
  16. }
  17.  
  18. }
  19.  
  20.  
  21. $obj = new WeatherService;
  22. $obj->getWeatherInfo("haifa");

Report this snippet  

You need to login to post a comment.