I am importing a CSV file that has 3 adjacent columns lets call them Size, Color and Item. I need to combine these columns and have one long column that has all these value WHILST stripping out the rows that have a no content in them.
至今,我仍在把这两者结合起来。
曾尝试过阵列——合并,但我没有爱。
$a = array($data[4]);
$b = array($data[5]);
$result = array_merge((array)$a, (array)$b);
print_r($result);
缩略语
我的结果是:
Array (
[0] => Size
[1] => Colour
)
Array (
[0] => Large
[1] => Black
)
Array (
[0] => Medium
[1] => Black
)
Array (
[0] => Small
[1] => Black
)
Array (
[0] => Extra Small
[1] => Black
)
Array (
[0] => Large
[1] => White
)
Array (
[0] => Medium
[1] => White
)
Array (
[0] => Small
[1] => White
)
Array (
[0] => Extra Small
[1] => White
)
Array (
[0] =>
[1] =>
)
我愿谈一下。
Array (
[0] => Size
[1] => Large
[2] => Medium
[3] => Small
[4] => Extra Small
[5] => Black
[6] => Black
etc....
)