/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
class WeatherService{ public function WeatherService(){ //some initialization... } public function getWeatherInfo($city, $method=""){ if ($methos=="CL") return convertFrToC($res); return $res; } public static function convertFrToC($val){ return (($val+40)*5/9)-40; } } //now it can also be used independently of the rest of the WeatherService //functions and main purpose... $c = WeatherService::convertFrToC(22);
Comments
