Re-order an Array

2011-11-14 Thread Gerrit
Hello everybody,

is there a method in CakePHP which allows me to convert the following
array to the expected result? I extract my start to a group by
creteria.

Array
(
[0] = Array
(
[Route] = Array
(
[id] = 3
[start] = Düsseldorf Hbf
[via] = Hannover Hbf
[end] = Kreiensen
)

)

[1] = Array
(
[Route] = Array
(
[id] = 2
[start] = Kreiensen
[via] = Hannover Hbf
[end] = Düsseldorf Hbf
)

)

[2] = Array
(
[Route] = Array
(
[id] = 4
[start] = Kreiensen
[via] =
[end] = Würzburg Hbf
)

)

[3] = Array
(
[Route] = Array
(
[id] = 5
[start] = Würzburg Hbf
[via] =
[end] = Kreiensen
)

)

)

To the following array:
?Array
(
[Düsseldorf Hbf] = Array
(
[id] = 3
[start] = Düsseldorf Hbf
[via] = Hannover Hbf
[end] = Kreiensen
)

),

[Kreiensen] = Array
(
[id] = 2
[start] = Kreiensen
[via] = Hannover Hbf
[end] = Düsseldorf Hbf
),
(
[id] = 4
[start] = Kreiensen
[via] =
[end] = Würzburg Hbf
)

)

[Würzburg Hbf] = Array
(
[id] = 5
[start] = Würzburg Hbf
[via] =
[end] = Kreiensen
)

)

)

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Re-order an Array

2011-11-14 Thread phpMagpie
http://book.cakephp.org/view/1492/combine

HTH, Paul.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php