Re: A kind of array (hashtable)

From: Date: Tue, 13 Aug 2002 15:23:25 +0000
Subject: Re: A kind of array (hashtable)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-112320@lists.php.net to get a copy of this message
Yes, PHP support indexing by strings and not only numbers/indexes. $myarray['elias'] = 'PHP rulez!'; echo $myarray['elias']; "Christian Ista" <christian.ista@teledisnet.be> wrote in message news:20020813120929.33453.qmail@pb1.pair.com... > Hello, > > In some language (like Java, C#, ...) you can find a hashtable. > > I execute query, this query return some records, each records are composed > by 2 fields. I'd like to put these records in a 2 dimensions array (or > something like that) and find easily the records I want. > > An example, the query return (field1/field2): > > mytext1 / "text for my text 1" > mytext2 / "text for my text 2" > mytext3 / "text for my text 3" > mytext4 / "text for my text 4" > > I'd like to put that in an array, but not find the text by myarray[2], > myarray[4] but by myarray['mytext2'], ['mytext2'] have to return "text > for > my text 2" > > Possible to do that ? > > Bye > > >

« previous php.general (#112320) next »