Re: dynamic associative array...

From: Date: Thu, 06 Jul 2000 00:05:17 +0000
Subject: Re: dynamic associative array...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-5108@lists.php.net to get a copy of this message
In article <4.3.2.7.2.20000704124610.02538e40@msm.cl>, marcelo@msm.cl ("Marcelo J. Iturbe") wrote: > Hello, > I have a while look which obtains 2 values from a file. > How can I turn it into a dynamic associative array? > I have no clue as to how many value=>pair lines I will fetch... > The loop is someting like. > while(!feof($fp)) { //> $tok = strtok(fgets($fp,128)," "); //> $canal[$i] = "$tok"; //> $tok = strtok(" "); //> $cantidad[$i] = "$tok"; $key = strtok(fgets($fp, 128), " "); $value = strtok(" "); $assoc[$key] = $value; > } -- Richard Lynch | If this was worth $$$ to you, buy a CD US Customer Support Director | from one of the artists listed here: Zend Technologies USA | http://www.L-I-E.com/artists.htm http://www.zend.com | (this has nothing to do with Zend, duh!)

« previous php.general (#5108) next »