At 3:36 PM -0400 6/18/09, Robert Cummings wrote:
tedd wrote:
At 1:45 PM -0400 6/18/09, Robert Cummings wrote:
Thanks to Rob and Daniel for also playing, better luck next time.
:-) - note smiley -- I do appreciate your time.
Mine version retains key associations. It wasn't a complete waste of
On 17 June 2009 22:12, tedd advised:
Hi gang:
Here's the problem. Let's say you have a collection of
arrays, such as:
$a = array();
$b = array();
$c = array();
$d = array();
And then you populate the arrays like so:
while(...)
{
$a[] = ...
$b[] = ...
$c[] =
Ford, Mike wrote:
On 17 June 2009 22:12, tedd advised:
Hi gang:
Here's the problem. Let's say you have a collection of
arrays, such as:
$a = array();
$b = array();
$c = array();
$d = array();
And then you populate the arrays like so:
while(...)
{
$a[] = ...
$b[] = ...
From: Ashley Sheridan
On Wed, 2009-06-17 at 19:27 -0400, tedd wrote:
At 10:54 PM +0100 6/17/09, Ashley Sheridan wrote:
I'd probably go with some sort of custom bubble sorting function.
Base
the sorting on your $d array, and then update the other arrays as
necessary. Should be OK if they all
From: Ashley Sheridan
On Wed, 2009-06-17 at 19:27 -0400, tedd wrote:
At 10:54 PM +0100 6/17/09, Ashley Sheridan wrote:
I'd probably go with some sort of custom bubble sorting function.
Base
the sorting on your $d array, and then update the other arrays as
necessary. Should be OK if they all
On Thu, Jun 18, 2009 at 05:11, Ford, Mikem.f...@leedsmet.ac.uk wrote:
array_multisort($d, $a, $b, $c) should do what you want,
That'll actually hit it right on the head, too, Mike. My example
from last night sorted and combined the arrays to be keyed and
sortable by $d --- which,
At 10:11 AM +0100 6/18/09, Ford, Mike wrote:
On 17 June 2009 22:12, tedd advised:
-snip-
Now, let's say you want to sort the $d array, but you also want the
arrays $a, $b, and $c to be arranged in the same resultant order as
$d.
For example, please follow this:
Before sort of $d:
$a
Ash:
You missed the point. I could use the built-in sort (i.e., sort() )
and sort the $d array. However, I would like the indexes of the other
arrays to match the new sort.
Cheers,
tedd
I think I might need a for-instance here, as you lost me!
Thanks
Ash
Ash:
You can sort any
tedd wrote:
At 10:11 AM +0100 6/18/09, Ford, Mike wrote:
On 17 June 2009 22:12, tedd advised:
-snip-
Now, let's say you want to sort the $d array, but you also want the
arrays $a, $b, and $c to be arranged in the same resultant order as
$d.
For example, please follow this:
Before
At 1:45 PM -0400 6/18/09, Robert Cummings wrote:
Thanks to Rob and Daniel for also playing, better luck next time.
:-) - note smiley -- I do appreciate your time.
Mine version retains key associations. It wasn't a complete waste of time.
Cheers,
Rob.
Rob:
Nothing you provide me is a
tedd wrote:
At 1:45 PM -0400 6/18/09, Robert Cummings wrote:
Thanks to Rob and Daniel for also playing, better luck next time.
:-) - note smiley -- I do appreciate your time.
Mine version retains key associations. It wasn't a complete waste of time.
Cheers,
Rob.
Rob:
Nothing you provide me
On Thu, 2009-06-18 at 13:04 -0400, tedd wrote:
Ash:
You missed the point. I could use the built-in sort (i.e., sort() )
and sort the $d array. However, I would like the indexes of the other
arrays to match the new sort.
Cheers,
tedd
I think I might need a
On Wed, 2009-06-17 at 17:11 -0400, tedd wrote:
Hi gang:
Here's the problem. Let's say you have a collection of arrays, such as:
$a = array();
$b = array();
$c = array();
$d = array();
And then you populate the arrays like so:
while(...)
{
$a[] = ...
$b[] = ...
...Sticking my neck out playing with the big boys (and girls) now...
I assume you've looked at array_multisort() for this, I would think you
could have multiple arrays being sorted with it (I've only ever used it for
2-array sorts). The other option would be to pop all those arrays into a
single
On Wed, 2009-06-17 at 22:54 +0100, Douglas Temple wrote:
...Sticking my neck out playing with the big boys (and girls) now...
I assume you've looked at array_multisort() for this, I would think you
could have multiple arrays being sorted with it (I've only ever used it for
2-array sorts).
At 10:54 PM +0100 6/17/09, Ashley Sheridan wrote:
I'd probably go with some sort of custom bubble sorting function. Base
the sorting on your $d array, and then update the other arrays as
necessary. Should be OK if they all have the same index, like in your
example. If you were using keys, could
On Wed, 2009-06-17 at 19:27 -0400, tedd wrote:
At 10:54 PM +0100 6/17/09, Ashley Sheridan wrote:
I'd probably go with some sort of custom bubble sorting function. Base
the sorting on your $d array, and then update the other arrays as
necessary. Should be OK if they all have the same index,
On Wed, Jun 17, 2009 at 17:11, teddt...@sperling.com wrote:
Hi gang:
[snip!]
Is there a slick way to do that?
Hacked together in the two minutes before I go to bed, so don't
complain about its inelegance. ;-P
?php
$a = array('apple', 'banana', 'grape', 'orange');
$b = array(100, 2111,
tedd wrote:
Hi gang:
Here's the problem. Let's say you have a collection of arrays, such as:
$a = array();
$b = array();
$c = array();
$d = array();
And then you populate the arrays like so:
while(...)
{
$a[] = ...
$b[] = ...
$c[] = ...
$d[] = ...
}
Now, let's say you want
On Wed, Jun 17, 2009 at 10:31:18PM -0400, Robert Cummings wrote:
snip
?php
function tedd_sort( $arrays )
{
$master = null;
$followers = array();
$first = true;
foreach( array_keys( $arrays ) as $key )
{
if( $first )
{
$first = false;
20 matches
Mail list logo