asort should do the trick.
Good Luck
Daryl
-Original Message-
From: Sparky Kopetzky [mailto:[EMAIL PROTECTED]
Sent: Saturday, June 28, 2003 9:50 AM
To: Daryl Meese; David Otton
Cc: PHP General
Subject: Re: [PHP] Sorting problem
Yes, I need the key to remain associated with the value
t; <[EMAIL PROTECTED]>
To: "David Otton" <[EMAIL PROTECTED]>
Cc: "PHP General" <[EMAIL PROTECTED]>
Sent: Friday, June 27, 2003 19:17
Subject: RE: [PHP] Sorting problem
> David,
>
> See what you mean. I guess we need some clarification on the original
David,
See what you mean. I guess we need some clarification on the original
question?
Thanks
-Original Message-
From: David Otton [mailto:[EMAIL PROTECTED]
Sent: Friday, June 27, 2003 8:09 PM
To: Daryl Meese
Cc: PHP General
Subject: Re: [PHP] Sorting problem
On Fri, 27 Jun 2003 19
On Fri, 27 Jun 2003 19:45:27 -0500, you wrote:
>ckeck out asort and arsort
I'm looking...
My understanding was that the original poster wanted to sort an array by
"value"|"key" ("sort an array and have the key 'follow' the value")
eg
'pear' => 'green',
'orange'=> 'orange',
'banana'
ckeck out asort and arsort
Daryl
-Original Message-
From: David Otton [mailto:[EMAIL PROTECTED]
Sent: Friday, June 27, 2003 7:41 PM
To: Sparky Kopetzky
Cc: PHP General
Subject: Re: [PHP] Sorting problem
On Fri, 27 Jun 2003 17:06:50 -0600, you wrote:
>I need to sort an array and h
On Fri, 27 Jun 2003 17:06:50 -0600, you wrote:
>I need to sort an array and have the key 'follow' the value. I know I could
>splice a string, sort it, then split it again but what a pain. Is there a
>simpler way?
AFAIK, there's no one-liner answer here. the usort() family of functions
pass either
value
body here
}
to see them in the correct order.
-Original Message-
From: Sparky Kopetzky [mailto:[EMAIL PROTECTED]
Sent: Friday, June 27, 2003 6:07 PM
To: PHP General
Subject: [PHP] Sorting problem
I need to sort an array and have the key 'follow' the value. I kn
I need to sort an array and have the key 'follow' the value. I know I could
splice a string, sort it, then split it again but what a pain. Is there a
simpler way?
Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net
--
PHP General Mailing List (http://www.php.net/)
To
Hi All,
I need to sort some data from a MySQL table. I have data saved like this:
++-++--+
| id | unixtime| porta_snmp | porta_switch |
++-++--+
| 1 | 2003-01-07 12:23:24 | 1614 | 1
9 matches
Mail list logo