$critics = array('Lisa Rose' => array('Lady in the Water' => 2.5, 'Snakes on a Plane' => 3.5, 'Just My Luck' => 3.0), 'Gene Seymour' => array('Lady in the Water' => 3.0, 'Snakes on a Plane' => 3.5, 'Just My Luck' => 1.5)); $list = array(); function test($prefs, $p1, $p2) { global $list; foreach(array_keys($prefs) as $item) if($item != $p1) foreach(array_keys($prefs[$item]) as $preferences) if (array_keys($prefs[$p1] == $preferences) array_push($list, $preferences); } #Find the number of elements $count = count($list); print_r (array_keys($critics)); test($critics, 'Lisa Rose', 'Gene Seymour');
Quote:if (array_keys($prefs[$p1] == $preferences)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)