Jump to content

[SOLVED] multi-dimensional arrays


lifeson2112

Recommended Posts

hello, I am reading info from a tab-delimited text file and I was wondering if anyone knew how to get this concept to work. I am trying to store the entire table in a two dimensional array, but the way I'm doing it right now won't work.

 

for($i=0; $i<$numrows; $i++)
{$columnsvalue[i] = explode("\t",$newfile[i]);}

 

does anyone else know how to better work with multi-dimensional arrays?

Link to comment
https://forums.phpfreaks.com/topic/42588-solved-multi-dimensional-arrays/
Share on other sites

Ok, here's what the field names for the demo tab file look like:

 

prod_id name availability caption price sale-price

 

I'm trying to get it so $columsvalue[0][0] returns "prod_id", $columnsvalue[0][2] returns "availability"....

I am just confused on the syntax I need to use for storing info in 2-dimensional-arrays using loops.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.