配列からExcelに変数を書き込もうとしていますが、特定のインスタンスで書き込めません
コードは以下の通り
$workbook =new Spreadsheet_Excel_Writer();
$workbook->send("response.xls");
$row=1;
$col=1;
$workbook->setVersion(8);
$worksheet =& $workbook->addWorksheet('My sheet ');
$Allquestions = $questions->getQuestions();
foreach ($Allquestions as $qkey=>$qval) {
foreach ($studentResponses as $rval){
$astresp= $rval->getResponse($qkey);
//$worksheet->write($row,$col,'hiii');
$worksheet->write($row, $col, $astresp);
$col++;
}
$row++;
$col=1;
}
$workbook->close();
$astresp を 'hihi' に変更すると Excel に hihi が出力されますが、$astresp のままだと Excel を開くことができません。