php - Export CSV: Illegal string offset -
i attempting write csv export php code:
header('content-type: text/csv; charset=utf-8'); header('content-disposition: attachment; filename=' . $project_name . ' - ' . $milestone_title . '.csv'); $output = '"milestone";"issue";"tag";"assignee";"state";"working time"' . "\n"; foreach ($_session['milestones'][$milestone_id] $issue) { $output .= '"' . $issue['milestone']['title'] . '";"' . $issue['title'] . '";"' . $issue['labels'] . '";"' . $issue['assignee']['name'] . '";"' . $issue['state'] . '";"' . $issue['working_time']['hours'] . '"' . "\n"; } echo $output; exit;
i following output when try generate csv using code, including number of warnings:
<b>warning</b>: illegal string offset 'milestone' in <b>c:\xampp\htdocs\gitlab\src\controllers.php</b> on line <b>135</b><br /> <br /> <b>warning</b>: illegal string offset 'title' in <b>c:\xampp\htdocs\gitlab\src\controllers.php</b> on line <b>135</b><br /> <br /> <b>warning</b>: illegal string offset 'title' in <b>c:\xampp\htdocs\gitlab\src\controllers.php</b> on line <b>135</b><br /> <br /> <b>warning</b>: illegal string offset 'labels' in <b>c:\xampp\htdocs\gitlab\src\controllers.php</b> on line <b>135</b><br /> <br /> <b>warning</b>: illegal string offset 'assignee' in <b>c:\xampp\htdocs\gitlab\src\controllers.php</b> on line <b>135</b><br /> <br /> <b>warning</b>: illegal string offset 'name' in <b>c:\xampp\htdocs\gitlab\src\controllers.php</b> on line <b>135</b><br /> <br /> <b>warning</b>: illegal string offset 'state' in <b>c:\xampp\htdocs\gitlab\src\controllers.php</b> on line <b>135</b><br /> <br /> <b>warning</b>: illegal string offset 'working_time' in <b>c:\xampp\htdocs\gitlab\src\controllers.php</b> on line <b>135</b><br /> <br /> <b>warning</b>: illegal string offset 'hours' in <b>c:\xampp\htdocs\gitlab\src\controllers.php</b> on line <b>135</b><br /> "milestone";"issue";"tag";"assignee";"state";"working time" "milestone1";"issue1";"";"─";"opened";"03" "0";"0";"0";"0";"0";"0"
can identify issue in code?
thanks helping!
i wrong milestones array
Comments
Post a Comment