我试图让这个代码工作,因为它正是我追求: http://www.reloadedpc.com/php/php-convert-csv-price-matrix-mysql-table/CSV矩阵到MySQL
虽然我得到这个错误:
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in C:\xampp\htdocs\matrix\Csv.php on line 580
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in C:\xampp\htdocs\matrix\Csv.php on line 580
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in C:\xampp\htdocs\matrix\Csv.php on line 580
Fatal error: Cannot access protected property Csv::$field_names in C:\xampp\htdocs\matrix\index.php on line 24
580线是以下Csv.php是:
$this->contents[$line_nr][(int) $position] = array_merge($this->contents[$line_nr][(int) $position]);
的index.php的
和线24(和23)是:
//get the row of width increments
$stack = $csv->field_names;
的Csv.php文件可以在这里看到: http://hg.mijnpraktijk.com/csv-library/src/e4397b31002d/Csv.php
有什么建议?
谢谢你们。
CNC中 整个代码块是:
foreach ($this->contents as $line_nr => $line)
{
if (array_key_exists((int) $position, $this->contents[$line_nr]))
{
$return[$line_nr] = $this->contents[$line_nr][(int) $position];
unset($this->contents[$line_nr][(int) $position]);
// reindex after removal
$this->contents[$line_nr][(int) $position] = array_merge($this->contents[$line_nr][(int) $position]);
}
}
它似乎取消它。 $ this-> contents [$ line_nr] [(int)$ position]是矩阵的标题。
你做任何调试,看看有什么'$这个 - >内容[$ line_nr] [(INT)$位置]'实际上是? – 2012-08-08 08:59:44
添加在原始帖子中 – user1380591 2012-08-08 09:07:57