Re: Explode to 2 dimensional array
| From: | (Richard Lynch) | Date: | Tue, 04 Jul 2000 02:01:15 +0000 |
| Subject: | Re: Explode to 2 dimensional array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4647@lists.php.net to get a copy of this message | ||
In article
<Pine.LNX.4.10.10007010848590.17446-100000@devcorps.goshen.edu>,
reubendb@goshen.edu ("Reuben D Budiardja") wrote:
> Hi
>
> This might be a dump question, but can I do something like this:
>
> while(blah..)
> {
> $pieces[$i] = explode(",", $words_separated_by_comma);
> $i++
> }
>
> to make 2 dimensional array of $pieces? if not, what is the alternative?
Yes, you can. You probably could have found out faster by trying it...
You can also just get rid of $i and $i++
$pieces[] = xxx;
will automagically insert at the end.
--
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!)