How do I make an array like this?

From: Date: Tue, 11 Jul 2000 04:59:27 +0000
Subject: How do I make an array like this?
Groups: php.general 
Request: Send a blank email to php-general+get-5852@lists.php.net to get a copy of this message
How do I make an array like this? Data File WallCost.csv Mel140,0.85,0.25 Mel120,1.05,0.5 Mel580,1.09,0.625 Mel340,1.13,0.75 Mel141,3.37,0.25 Mel121,3.57,0.5 Mel581,3.61,0.625 Mel341,3.65,0.75 What I have and it works. while ($data = fgetcsv($fp,10000)) //Turns the file into an array by looping... $num = count($data); //The array... $wallCab[$row] = array(trim($data[0]), trim($data[1]), trim($data[2])); Print($wallCab[$row][0]." ".$wallCab[$row][1]." ".$wallCab[$row][2]."<br>\n"); $row++; //Counter } I get $wallCab[1][0]="Mel140" $wallCab[1][1]=.85 $wallCab[1][2]= .25 Just what it is suppose to do. What I want... $row="Mel140"; $wallCab[$row][1]= .85 and $wallCab[$row][2]= .52 Thanks Ted Knudson http://www.automatedcabinets.com http://www.pulsarusa.com

« previous php.general (#5852) next »