How do I create line breaks when passing a string into codeigniter’s download helper. I have tried the code below which succesfully downloads the file and the string but it just outputs directly the \r\n rather than converting them into new lines. Any help would be greatly appreciated:
$reportOutput = '';
foreach($data['displayPostingRecords'] as $result)
{
$reportOutput .= rawurldecode($result['wpPostlink']).' \r\n ';
}
//download the file..
$fileName = 'report-articleBatchID-'.$articleBatchID.'.txt';
$this->load->helper('download');
force_download($fileName, $reportOutput);
Sorry long day… change the single tick quotes to regular quotes and that’ll fix your problem.