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

Cpanel official API? ( PHP )

Posted by stormridermay, 01-08-2008, 08:39 PMHello, I'm writing my own billing/hosting system....

horde webmail issue

Posted by madpato, 06-26-2008, 02:47 PMHi, me again U.u I have a problem with horde webmail I...

Activity on Ports 1028 and 135

Posted by FFCus, 01-14-2008, 12:54 AMUsing Active Ports, my Windows 2003 server is showing a very...

Can a server log a user out of a script?

Posted by iowaguy1, 03-19-2007, 03:07 PMI am having a site coded for me and I noticed that I get...

Redrect - make it impossible to trace source

Posted by ntesla123, 02-10-2011, 08:51 PMHow do I make a redirect that would redirect someone to...