PHP code example of isesame / weather

1. Go to this page and download the library: Download isesame/weather library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

isesame / weather example snippets


      $key = 'bb5e3bd493d1f29f52f9d8ee4bf47049';
      $w = new \Isesame\Weather\Weather($key);
   
      $w->getLiveWeather('深圳');
      $w->getForecastsWeather('深圳','xml');
      

   app('weather')->getLiveWeather('深圳');
    
   或
   
   public function show(Request $request, Weather $weather, $city)
   {
       return $weather->getWeather($city);
   }