→ elba:$ydata=array(); 05/12 21:28
→ elba:$ydata[]=你要加入的值; 05/12 21:29
E大我知道是這樣寫~
但我寫的格式都有問題~
像這樣
http://nerv3890.blogspot.tw/2013/05/jpgraphexcer.html
感覺問題是出在
for($currentRow = 0;$currentRow < $allRow;$currentRow++){
$ydata[$i]=$array["$col"];
}
這邊compile都會出錯
我不知道怎麼把Excel讀出來的值配到陣列$ydata裡~
※ 編輯: nerv3890 來自: 140.112.246.104 (05/12 21:44)
→ nerv3890:已解決~ 05/12 23:30
→ nerv3890:謝謝E大!!! 05/12 23:30
附上E大的解決方案
$ydata = array();
for($currentRow = 0;$currentRow < $allRow;$currentRow++){
$ydata[] = $currentSheet->getCell("A{$currentRow}")->getValue();
}
不用兩個迴圈,直接把抓到的值加進$ydata裡就好了
※ 編輯: nerv3890 來自: 140.112.246.104 (05/12 23:31)
→ joedenkidd:phpexcel 好像有一個 getarray動作可以把excel ->array 05/13 08:51