note 89368 deleted from function.array-intersect by danbrown

From: Date: Wed, 04 Mar 2009 21:35:36 +0000
Subject: note 89368 deleted from function.array-intersect by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-151487@lists.php.net to get a copy of this message
Note Submitter: chris Reason: bad code ---- for intersection of unknown number of arrays: $masterArray = // array of arrays $finalArray = $masterArray[0]; foreach($masterArray as $subArray) { $finalArray = array_intersect($finalArray, $innerArray); } $finalArray is now the intersection of all arrays in $masterArray

« previous php.notes (#151487) next »