Well I have the following array:
$produtos2[] = array(
"cod" => (int) 768,
"nome" => "LOGITECH M535",
"GRUPO" => "MOUSE"
);
$produtos2[] = array(
"cod" => (int) 2334,
"nome" => "MULTILASER DECT",
"GRUPO" => "TECLADO"
);
$produtos2[] = array(
"cod" => (int) 334,
"nome" => "PANASONIC DECT",
"GRUPO" => "MOUSE"
);
$produtos2[] = array(
"cod" => (int) 3334,
"nome" => "APPLE DECT",
"GRUPO" => "TECLADO"
);
$produtos2[] = array(
"cod" => (int) 234,
"nome" => "SAMSUNG D499",
"GRUPO" => "MOUSE"
);
To list the result of the array I do this:
// Navega pelos elementos do array
foreach ($produtos as $c) {
echo $c['nome']."<br>";
}
The result is:
LOGITECH M535
MULTILASER DECT
PANASONIC DECT
APPLE DECT
SAMSUNG D499
Well what I need is to separate the products from having the same group and listing them by group, for example:
MOUSE
LOGITECH M535
PANASONIC DECT
SAMSUNG D499
TECLADO
MULTILASER DECT
APPLE DECT
I have no idea how to do this.