PHP-Code:
$temp = array()
foreach ($meinarray as $wert1) {
foreach ($wert1 as $wert2) {
if(in_array($wert2,$temp)){
continue;
}
echo "$wert2 ";
}
$temp[] = $wert1['name']
echo "<br>";
}
Gruss
tobi
$temp = array()
foreach ($meinarray as $wert1) {
foreach ($wert1 as $wert2) {
if(in_array($wert2,$temp)){
continue;
}
echo "$wert2 ";
}
$temp[] = $wert1['name']
echo "<br>";
}
<?php
$meinarray = array(array("Name"=>"Maier",
"Vorname"=>"Hans",
"Personalnummer"=>6714,
"Abteilung"=>1),
array("Name"=>"Maier",
"Vorname"=>"Gans",
"Personalnummer"=>6711,
"Abteilung"=>1),
array("Name"=>"Maier",
"Vorname"=>"Schranz",
"Personalnummer"=>6712,
"Abteilung"=>1),
array("Name"=>"Schmitz",
"Vorname"=>"Peter",
"Personalnummer"=>81343,
"Abteilung"=>2),
array("Name"=>"Balu",
"Vorname"=>"banana",
"Personalnummer"=>81344,
"Abteilunglt"=>2));
// und weitere
$anzahl = count($meinarray);
//ausgabe
foreach ($meinarray as $wert1) {
foreach ($wert1 as $wert2) {
echo "$wert2 ";
}
echo "<br>";
}
/*
for($i=0; $i<$anzahl; $i++)
{
while(list($name,$wert) = each($meinarray[$i]))
{
echo "$wert ";
}
echo "<p>";
}
*/
?>
Einen Kommentar schreiben: