function difference() { $collections = func_get_args(); $union = union($collections); $intersection = intersection($collections); $difference = without($union, $intersection); $difference = values($difference); // Re-indexes array return $difference; }
function recursiv($country, &$end_result) { $end_result = $end_result . "," . $country; $query = "SELECT d.div_id FROM `div` d where d.parentdiv_id in (" . $country . ")"; $res = mysql_query($query); $count_res = mysql_num_rows($res); if ($count_res != 0) { while ($row = mysql_fetch_array($res)) { $countries[] = $row[0]; } recursiv(without($countries, 0), $end_result); } }