2017-06-05 60 views

回答

1

试试这个 //我不知道什么是QIF文本格式,但这个你可以写一个文件

write_file.php

public function write_qif($info){ 
    $this->load->helper(array('file','download')); 
    $_info = $this->some_model->get_info($info);//return object 
    $qif_text = ' 
       !Type:'.$_info->type.'//BANK 
       D'.$_info->date1.'//03/03/10 
       T-379.00 
       P'.$_info->city.'//CITY OF 
       ^
       D'.$_info->date2.'//03/04/10 
       T-20.28 
       P'.$_info->maket_place.'//YOUR LOCAL SUPERMARKET 
       ^
       D'.$_info->date3.'//03/03/10 
       T-421.35 
       P'.$_info->product.'//...WATER UTILITY 
       '; 

    if (! write_file('./path/to/file.qif', $_info)){ 
     echo 'Unable to write the file'; 
    } 
    else{ 
     $data = file_get_contents(.'/path/to/file.qif'); 
     $name = 'myqiffile.qif'; 

     force_download($name, $data); 
     echo 'File written!'; 
    } 
} 
+0

谢谢你@elddenmedio,你的ans对我有帮助... – Angel

相关问题