PHP warning

Cannot modify header information - headers already sent by (output started at /homepages/46/d829343105/htdocs/letstravel/en_ly/protected/controllers/MarketController.php:242)

/homepages/46/d829343105/htdocs/letstravel/en_ly/protected/controllers/TopController.php(1347)

1335 //            //}
1336 //
1337 //    }
1338 //
1339 //
1340 //
1341 //return  $rate;
1342 //}
1343 
1344 //使用雅虎实时汇率接口
1345 function ExchangeRate($from_Currency,$to_Currency)
1346 {        
1347         header("Content-type: textml; charset=utf-8"); 
1348         /* 雅虎汇率已挂
1349         $rate = Yii::app()->cache->get($from_Currency.'_'.$to_Currency);
1350         if($rate===false){
1351         $all=$from_Currency.$to_Currency;
1352         $file = fopen("http://download.finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s=$all=x",'r');    //参数s=EURCNY, 欧元换人民币, 根据需要更换
1353     while ($data = fgetcsv($file))      //读取CSV文件里的每一行内容
1354     {
1355     $goods_list[] = $data;
1356     }
1357     $shijian = $goods_list[0][2] .' '. $goods_list[0][3];      //根据 quotes.csv文件得到的数据, 当前时间 在3,4列位置
1358     $rate = $goods_list[0][1];
1359                                 //根据 quotes.csv文件得到的数据, 汇率 在2列位置 

Stack Trace

#0
+
 /homepages/46/d829343105/htdocs/letstravel/en_ly/protected/controllers/TopController.php(1347): header("Content-type: textml; charset=utf-8")
1342 //}
1343 
1344 //使用雅虎实时汇率接口
1345 function ExchangeRate($from_Currency,$to_Currency)
1346 {        
1347         header("Content-type: textml; charset=utf-8"); 
1348         /* 雅虎汇率已挂
1349         $rate = Yii::app()->cache->get($from_Currency.'_'.$to_Currency);
1350         if($rate===false){
1351         $all=$from_Currency.$to_Currency;
1352         $file = fopen("http://download.finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s=$all=x",'r');    //参数s=EURCNY, 欧元换人民币, 根据需要更换
#1
+
 /homepages/46/d829343105/htdocs/letstravel/en_ly/protected/controllers/TopController.php(1154): TopController->ExchangeRate("USD", "GBP")
1149         }else{
1150             if($rateConfigModel){
1151 
1152                 if($rateConfigModel->autochange == 1){//使用实时汇率
1153                     //echo '/2';
1154                     $rate = $this->ExchangeRate($from_Currency,$to_Currency);//暂时关闭
1155 
1156                     if(!$rate){
1157 
1158                         $rateModel = Rate::model()->find(array('select'=>'rate','condition'=>"code='$to_Currency'"));
1159                         $rate = $rateModel->rate;
#2
+
 /homepages/46/d829343105/htdocs/letstravel/en_ly/protected/controllers/MarketController.php(111): TopController->getRateValue("USD", "GBP")
106         $usd=DaytripsOrder::model()->findAll(array('condition'=>"status=1 and rate='USD'"));
107         $eur=DaytripsOrder::model()->findAll(array('condition'=>"status=1 and rate='EUR'"));
108         $GBP=$this->addall($gbp);
109         $USD=$this->addall($usd);
110         $EUR=$this->addall($eur);
111         $haspay=$GBP+$this->getRateValue('USD','GBP')*$USD+$this->getRateValue('EUR','GBP')*$EUR;
112         $setamount=DaytripsAmount::model()->find(1);
113         if($setamount && $setamount->status==1){
114             $addamount=$setamount->amount;
115         }else{
116             $addamount=0;
2020-07-13 22:58:01 Apache Yii Framework/1.1.15