note 77352 deleted from function.in-array by bjori

From: Date: Sun, 26 Aug 2007 08:27:56 +0000
Subject: note 77352 deleted from function.in-array by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-129798@lists.php.net to get a copy of this message
Note Submitter: andry at zionit dot ru Reason: non-english ---- Сравнение 2 массивов Пытался так =)) <?php $arr1 = array(1, 2); $arr2 = array(2, 3); echo in_array($arr1, $arr2); ?> Работающая ф-ия <?php function arrays_in($arr1, $arr2) { $result = 0; foreach($arr1 as $uid=>$val) { if(in_array($val, $arr2)) $result++; } return ($result==0)?false:$result; } ?> http://zionit.ru/

« previous php.notes (#129798) next »