Re: Trying to reduce arrays

2011-12-08 Thread McScreech
Here's what I came up with. function flattenArray($a) { // reduce raw matrix to single level matrix of matrices // that will be the rows in results table. $r1 = array(); $r2 = array(); foreach ($a as $k1 = $v1) { foreach ($v1 as $k2 = $v2) {

Re: Trying to reduce arrays

2011-12-07 Thread McScreech
OK, thanks. I'm reading 'set.php' and see external references such as ' * See the unit test for more information.' Where do I look for that? -- 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

Trying to reduce arrays

2011-12-06 Thread McScreech
I am completely stumped. I have tried combinations of Set::extract, Set::classicExtract, Set::combine, and Set::flatten to get the results I show below. Perhaps this is a straight php question rather than cakePHP? 1) How do I obtain the results demonstrated? 2) How do I extract the key _names_

Re: Trying to reduce arrays

2011-12-06 Thread euromark
you can always use foreach() ;) the set:: methods wont use anything else, either (internally) so its also the quickest way of doing it. On 6 Dez., 22:41, McScreech scre...@sympatico.ca wrote: I am completely stumped. I have tried combinations of Set::extract, Set::classicExtract,

Re: Trying to reduce arrays

2011-12-06 Thread Miles J
What euromark said, just do your own forloop and append them to a new array. On Dec 6, 1:58 pm, euromark dereurom...@googlemail.com wrote: you can always use foreach() ;) the set:: methods wont use anything else, either (internally) so its also the quickest way of doing it. On 6 Dez.,