私が取り組んでいる配列の例を次に示します。
Array
(
[0] => Array
(
[id] => 1331
[shortname] => MCS-115-113C
[userid] => 663
[email] => asdfasfd@asdfasfd.br
[username] => FOOBARBAZ
[nombrecompleto] => asdfasdf
[lastlogin] => 1367501486
)
[1] => Array
(
[id] => 1331
[shortname] => MAFA-EOOF
[userid] => 323
[email] => asdfasfd@asdfasfd.br
[username] => FOOBARBAZ
[nombrecompleto] => asdfasdf
[lastlogin] => 136732186
)
[2] => Array
(
[id] => 1331
[shortname] => MKT-FOOBAR
[userid] => 434
[email] => asdfasfd@asdfasfd.br
[username] => adsfasdf
[nombrecompleto] => asdfasdf
[lastlogin] => 1367234486
)
私の場合、username
配列内の要素を比較して重複を削除したいと考えています。
したがって、この場合、usernameFOOBARBAZ
との 2 つの要素のみを返しadsfasdf
ます。
Array
(
[0] => Array
(
[id] => 1331
[shortname] => MAFA-EOOF
[userid] => 323
[email] => asdfasfd@asdfasfd.br
[username] => FOOBARBAZ
[nombrecompleto] => asdfasdf
[lastlogin] => 136732186
)
[1] => Array
(
[id] => 1331
[shortname] => MKT-FOOBAR
[userid] => 434
[email] => asdfasfd@asdfasfd.br
[username] => adsfasdf
[nombrecompleto] => asdfasdf
[lastlogin] => 1367234486
)
PHPでこれを達成するにはどうすればよいですか?