Esempio n. 1
0
function difference()
{
    $collections = func_get_args();
    $union = union($collections);
    $intersection = intersection($collections);
    $difference = without($union, $intersection);
    $difference = values($difference);
    // Re-indexes array
    return $difference;
}
Esempio n. 2
0
{
    $rowarray = array();
    foreach ($modelid as $val) {
        //echo $val."---------";
        $temp = getFriendslist($val);
        //print_r($temp);
        for ($i = 0; $i < count($temp); $i++) {
            if (!in_array($temp[$i], $rowarray)) {
                $rowarray[] = $temp[$i];
            }
        }
    }
    return $rowarray;
}
$modelid = getAllModelId();
$row = union($modelid);
$namearray = array();
$resultarray = array();
foreach ($modelid as $idvalue) {
    //echo $idvalue;
    $resultrow = array();
    $resultrow[] = getModelName($idvalue);
    $friends = getFriendslist($idvalue);
    foreach ($row as $rowvalue) {
        //echo $rowvalue;
        //print_r($friends);
        if (in_array($rowvalue, $friends)) {
            $resultrow[] = "o";
        } else {
            $resultrow[] = "x";
        }