need help grouping a array

Posted by smarty-boots, 10-24-2012, 10:57 AM
Hi I have this as a array: and I need to group it like this (there is 600+ in the over all array): can anyone help me out please? but when I try this: all I get is the last out put and this error: Warning: Invalid argument supplied for foreach() Last edited by smarty-boots; 10-24-2012 at 11:04 AM.

Posted by zoid, 10-24-2012, 01:51 PM
Can you correct your array code? It is not valid PHP code.

Posted by Herasil, 10-24-2012, 02:25 PM
PHP array guide: http://www.w3schools.com/php/func_array.asp Is this what you wanted your $sets variable to look like? The one you provided has many errors. However, this would cause an error in your foreach loop, because the nested foreach loop assumes that $records is also an array, but just "B" is not an array, hence the "Invalid argument supplied for foreach()" warning you got. You could fix this by changing $sets to:

Was this answer helpful?

 Print this Article

Also Read

Trademark: Host Unlimited Domains

Posted by Samuel, 09-03-2002, 04:24 PMThere is a host trying to do this.. lol Posted by...

PHP in htm problem

Posted by HWLJr, 03-04-2010, 07:59 PMI have a Blue Quartz server which seems to run htm, html and...

PHP Mail Help

Posted by Danny159, 02-08-2011, 10:19 AMHey, I have the following script, and I am trying to...

Adult Hosting

Posted by Nell, 09-03-2002, 02:07 AMI search resellers hosting plan for adult sites. The main...

Elgg - Group Discussions

Posted by jamiedolan, 02-12-2011, 07:20 PMHello; I found a free application called Elgg. It's...