php associative array duplicate values code example
Example: an associative array save duplicated values under single key
$unique = array_reduce($subject, function($final, $article){
static $seen = array();
if ( ! array_key_exists($article['fk_article_id'], $seen)) {
$seen[$article['fk_article_id']] = NULL;
$final[] = $article;
}
return $final;
});