document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <?php
  2. $xml = simplexml_load_file("http://www.google.com/ig/api?weather=milan");
  3. $day=array();
  4. $low=array();
  5. $high=array();
  6. $icon=array();
  7. $condition =array();
  8. $humidity=array();
  9. $wind_condition=array();
  10. $googlePath="http://www.google.com";
  11.  
  12.  foreach($xml->children() as $child)
  13.  {
  14.    
  15.      foreach($child->children() as $schild)
  16.           {
  17.                  
  18.                 if($schild->getName()!=" ")
  19.                 {
  20.                     if( $schild->getName()=="forecast_conditions")
  21.                     {
  22.                
  23.                         foreach($schild->children() as $sschild)
  24.                           {
  25.                              
  26.                                 if( $sschild->getName()=="day_of_week")
  27.                                 {
  28.                                     $day[]= $sschild[\'data\'];
  29.                                 }
  30.                                 if( $sschild->getName()=="low")
  31.                                 {
  32.                                     $low[]= $sschild[\'data\'];
  33.                                 }
  34.                                 if( $sschild->getName()=="high")
  35.                                 {
  36.                                     $high[]= $sschild[\'data\'];
  37.                                 }
  38.                                 if( $sschild->getName()=="icon")
  39.                                 {
  40.                                     $icon[]= $sschild[\'data\'];
  41.                                 }
  42.                                 if( $sschild->getName()=="condition")
  43.                                 {
  44.                                     $condition[]= $sschild[\'data\'];
  45.                                 }
  46.                                
  47.                           }
  48.                     }
  49.                    
  50.                     if( $schild->getName()=="current_conditions")
  51.                     {
  52.                         foreach($schild->children() as $sschild)
  53.                           {
  54.                               if( $sschild->getName()=="humidity")
  55.                                 {
  56.                                     $humidity= $sschild[\'data\'];
  57.                                 }
  58.                                
  59.                               if( $sschild->getName()=="wind_condition")
  60.                                 {
  61.                                     $wind_condition = $sschild[\'data\'];
  62.                                 }
  63.                           }
  64.                          
  65.                     }
  66.                    
  67.                 }
  68.  
  69.          
  70.          
  71.           }
  72.    
  73.  }
  74.  
  75.  
  76.  
  77. ?>
');