Hi,
I am trying to dynamically get a specific data array by using a function (parsing an excel file, so for instance, I can grab the fourth column of the file as follows):
foreach ($obj->Worksheet->Table->Row as $row)
{
$rows[] = (string)$row->Cell[4]->Data;
}
My problem is im trying to dynamically specify the "cell" to get and I dont know how to properly format it as I cant use $ within the [] apparently. So Im trying to do this and its not working:
$col = 4;
foreach ($obj->Worksheet->Table->Row as $row)
{
$rows[] = (string)$row->Cell[$col]->Data;
}
Any help much appreciated. Thanks!