我有这样的对象:
class Log
{
public matches;
public function __construct()
{
$this->matches = array();
}
}
class Match
{
public owner;
public stuff;
}
在我的整个程序中,我将数据存储到$owner
并$stuff
通过遍历 Log 对象的数组匹配来访问它。我想知道的是如何获得一个包含所有唯一所有者列表的数组。
例如,如果我有以下信息:
Bill SomeStuff
Bob SomeOtherStuff
Stan MoreOtherStuff
Bill MoreOfBillsStuff
Bill BillhasLotsofStuff
如何获取仅包含Bill
, Bob
,的数组Stan
?