note 84558 modified in function.array-diff by danbrown
| From: | danbrown@php.net | Date: | Sat, 19 Jul 2008 14:40:53 +0000 |
| Subject: | note 84558 modified in function.array-diff by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-141693@lists.php.net to get a copy of this message | ||
A creative but exact (and slow) way to see if two array are different.
<?php
$diff= (count(array_intersect($arr1,$arr2)) == count(array_unique(array_merge($arr1,$arr2)))) ?
FALSE : TRUE;
?>
--was--
A creative but exact (and slow) way to see if two array are different.
$diff= (count(array_intersect($arr1,$arr2)) == count(array_unique(array_merge($arr1,$arr2)))) ?
FALSE : TRUE;
http://php.net/manual/en/function.array-diff.php