Yes, PHP support indexing by strings and not only numbers/indexes.

$myarray['elias'] = 'PHP rulez!';

echo $myarray['elias'];

"Christian Ista" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to