note 16515 added to function.array-intersect
| From: | developer at i-space dot org | Date: | Fri, 02 Nov 2001 16:46:06 +0000 |
| Subject: | note 16515 added to function.array-intersect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-20303@lists.php.net to get a copy of this message | ||
i didn't found any funcs for counting occurences in an array, so i use something like that :
$a[0] = "0";
$a[1] = "1";
$a[2] = "2";
$a[3] = "3";
$a[4] = "1";
$a[5] = "5";
$a[6] = "1";
$a[7] = "7";
$b[0] = "2";
$c = array_diff($a, $b);
echo (count($a) - count($c));
if you know a better way to do it - mail me :)
--
http://www.php.net/manual/en/function.array-intersect.php
http://master.php.net/manage/user-notes.php?action=edit+16515
http://master.php.net/manage/user-notes.php?action=delete+16515
http://master.php.net/manage/user-notes.php?action=reject+16515