4 ){ //reload the image every 4 hours $phpstr = ""; $contents = httpSocketConnection('feeds.feedburner.com', "GET", $http_get_path, $qString); $fp = fopen( "feedburner.php","r" ); while(!FEOF($fp)){ $tmp = fgets($fp,4096); if(substr_count($tmp, 'lastupdate=') ) $tmp = "\$lastupdate= ".date('YmdH').";\n"; $phpstr .= $tmp; if( $tmp == "//the end of php file" ) { $phpstr .= "\n\?>"; break; } } $phpstr .= $contents; $fp =fopen( "feedburner.php","w" ); fwrite($fp , $phpstr); fclose($fp); die($contents); } //the end of php file ?>