note 77352 added to function.in-array

From: Date: Sat, 25 Aug 2007 18:49:00 +0000
Subject: note 77352 added to function.in-array
Groups: php.notes 
Request: Send a blank email to php-notes+get-129784@lists.php.net to get a copy of this message
Сравнение 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/ ---- Server IP: 69.147.83.197 Probable Submitter: 91.124.106.159 ---- Manual Page -- http://www.php.net/manual/en/function.in-array.php Edit -- https://master.php.net/note/edit/77352 Del: integrated -- https://master.php.net/note/delete/77352/integrated Del: useless -- https://master.php.net/note/delete/77352/useless Del: bad code -- https://master.php.net/note/delete/77352/bad+code Del: spam -- https://master.php.net/note/delete/77352/spam Del: non-english -- https://master.php.net/note/delete/77352/non-english Del: in docs -- https://master.php.net/note/delete/77352/in+docs Del: other reasons-- https://master.php.net/note/delete/77352 Reject -- https://master.php.net/note/reject/77352 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#129784) next »