Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199901

Re: [PHP3] Sorting multiple arrays From: Andrew Chen (achen <email protected>)
Date: 01/04/99

Okay, already found an error. It looks like it would actually be:

$val["berlin"] that would eval to bier.

Let me know if you find anything else wrong.

Andrew

On Mon, 4 Jan 1999, Andrew Chen wrote:

> I haven't looked at PHP in a little bit, so though the syntax will be
> wrong, the ideas will be right. I think you can create associative arrays
> (otherwise known as hashes) in PHP3 through:
>
> $val = ("berlin"=>"bier",
> "amsterdam"=>"dope",
> "paris"=>"wine",
> "brussels"=>"food");
>
> "berlin" would be the key, and "bier" is the value. The idea is that
> you can get a value by using the key, for example:
>
> $val{"berlin"} evaluates to "bier" -- the syntax is probably wrong, so
> make sure you check.
>
> Anyway, if you look in the array section of the manual, there is a
> specific function to do this... a quick glance yields usort() as a
> candidate. I could be wrong-- check it out.
>
> Andrew
>
> On Mon, 4 Jan 1999, Casper Scheffer wrote:
>
> > Hello,
> >
> > Can anyone give me some help how to sort a multiple array:
> >
> > f.i.
> >
> > $val[0][0] = 'berlin' $val[0][1] = 'bier'
> > $val[1][0] = 'amsterdam' $val[1][1] = 'dope'
> > $val[2][0] = 'paris' $val[2][1] = 'wine'
> > $val[3][0] = 'brussels' $val[3][1] = 'food'
> >
> > How do I sort this list on the second element?
> >
> >
> > Thanks,
> >
> > Casper
> >
> > --
> > PHP 3 Mailing List http://www.php.net/
> > To unsubscribe send an empty message to php3-unsubscribe <email protected>
> > To subscribe to the digest list: php3-digest-subscribe <email protected>
> > For help: php3-help <email protected> Archive: http://www.php.net/mailsearch.php3
> > List administrator: zeev <email protected>
> >
> >
> >
>
>
>
> --
> PHP 3 Mailing List http://www.php.net/
> To unsubscribe send an empty message to php3-unsubscribe <email protected>
> To subscribe to the digest list: php3-digest-subscribe <email protected>
> For help: php3-help <email protected> Archive: http://www.php.net/mailsearch.php3
> List administrator: zeev <email protected>
>
>
>

--
PHP 3 Mailing List   http://www.php.net/
To unsubscribe send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest list:  php3-digest-subscribe <email protected>
For help: php3-help <email protected>  Archive:  http://www.php.net/mailsearch.php3
List administrator:  zeev <email protected>