merhaba, aşağıdaki fonksiyonu localhostta sorunsuz kullanabilmeme rağmen , hosta attığımda değerlerin oluşturulmaması gibi bi problem yaşıyorum. Yani hiç bir hata vermemesine rağmen veride çekilmiyor. Sorun nedir sizce arkadaşlar?

not : makinada fopen kullanımı açık

hava.fonk.php
<?
Class erguner 
{
 function dayadd($days,$date=null , $format="d/m/Y"){
  // add days to a date
  return date($format,strtotime($days." days",strtotime( $date ? $date : date($format) )));
 }
 private function attr($s,$attrname) {
  //retrn html attribute
  preg_match_all('#\s*('.$attrname.')\s*=\s*["|\']([^"\']*)["|\']\s*#i', $s, $x); 
  if (count($x)>=3) return $x[2][0];
  return "";
 }
public function hava($q,$thedate="") {

  //(teşekkürler google)
  if (!$thedate) $date = date("Y-m-d"); //bugün
   else $date = $thedate;
  if ($date>$this->dayadd(3,date("Y-m-d"),"Y-m-d"))return "";
  // verileri alalım
  $web_page = file_get_contents( "http://www.google.com.tr/search?q=weather+" . urlencode($q) );
  //parçalayalım
  preg_match_all('#<div class=e>(.*)</table>#Us', $web_page, $m);
  if (count($m)>0) {
   
   $p = array();
   preg_match_all('#<img([^>]*)?>#Us', $m[0][0], $img);
   for ($i=0;$i<count($img[0]);$i++) {
    $tag = str_replace("src=\"/","src=\"http://www.google.it/",$img[0][$i]);
    $p[$i]["date"]=$this->dayadd($i,date("Y-m-d"),"Y-m-d");
    $p[$i]["title"] = $this->attr($tag,"title");
    $p[$i]["img"] = $this->attr($tag,"src");
   }
   preg_match_all('#<nobr>(.*)</nobr>#Uis', $m[0][0], $nobr);
   for ($i=0;$i<count($nobr[1]);$i++) {
    $temp= explode("|",$nobr[1][$i]);
    $p[$i]["min"] = trim($temp[1]) ;
    $p[$i]["max"] = trim($temp[0]) ;
   }
   return (!$thedate?$p:$p[$date]);
  }
  return array();
 }
 }
?>

Kullanım (index.php)

   <?
include "hava.fonk.php";
$c = "Bursa"; //Şehir
$erguner = new erguner;
$go = $erguner->hava($c); echo "<h1>".$c." hava durumu</h1>".$go[0][date]."<br>".$go[0][title]."<br><img src='".$go[0][img]."'><br>".$go[0][min]."<br>".$go[0][max];
?>