I have objects such as these:
class Log
{
public matches;
public function __construct()
{
$this->matches = array();
}
}
class Match
{
public owner;
public stuff;
}
Throughout my program, I store data into $owner and $stuff and access it via iterating through the array matches for the Log object. What I am wondering is how to get an array containing a list of all the unique owners.
For example, if I have the following information:
Bill SomeStuff
Bob SomeOtherStuff
Stan MoreOtherStuff
Bill MoreOfBillsStuff
Bill BillhasLotsofStuff
How do I go about getting an array that contains merely Bill, Bob, Stan?
This is an example function that you could add to the
Logclass to return a list of owners: