ichbinich: Problem mit array_unique

Beitrag lesen

Hallo,

Das ist schon soweit gut. Ich möchte aber die DOPPELTEN TAGS mit foreach (array_unique($articles) as $article) AUSSORTIEREN, sodass ich folgendes Ergebnis erhalte:

wenn du an den Ausgangsarrays nichts ändern kannst(willst) bleibt die wohl nur eine doppelte foreach-Schleife:

$articles = array($article1, $article2, $article3);  
  
$uniqueTags = array();  
foreach($articles as $article) {  
	foreach($article as $tag) {  
		if(!in_array($tag, $uniqueTags))  
			$uniqueTags[] = $tag;  
	}  
}  
print_r($uniqueTags);

vg ichbinich

--
Kleiner Tipp:
Tofu schmeckt am besten, wenn man es kurz vor dem Servieren durch ein saftiges Steak ersetzt...