nicki: Problem mit array_unique

Beitrag lesen

Hallo

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);


>   
  
Danke für den ansatz. Wie bekomme ich aber damit die arraywerte $article['tag'] und $ article ['tag2']?  
  
Gruß, Nicki