note 87142 added to function.array-diff
| From: | bluej100 at gmail | Date: | Thu, 20 Nov 2008 23:17:37 +0000 |
| Subject: | note 87142 added to function.array-diff | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-146784@lists.php.net to get a copy of this message | ||
Uh, guys? The way to see if two arrays are equal is the equality operator.
$ php -r 'var_dump(array("a"=>array(1,2), "b"=>3) ==
array("a"=>array(1,"2"), "b"=>3));'
bool(true)
$ php -r 'var_dump(array("a"=>array(1,2), "b"=>3) ==
array("a"=>array(1,"4"), "b"=>3));'
bool(false)
$ php -r 'var_dump(array("a"=>array(1,2), "b"=>3) ===
array("a"=>array(1,"2"), "b"=>3));'
bool(false)
$ php -r 'var_dump(array("a"=>array(1,2), "b"=>3) ===
array("a"=>array(1,2), "b"=>3));'
bool(true)
----
Server IP: 69.147.83.197
Probable Submitter: 63.226.115.226
----
Manual Page -- http://www.php.net/manual/en/function.array-diff.php
Edit -- https://master.php.net/note/edit/87142
Del: integrated -- https://master.php.net/note/delete/87142/integrated
Del: useless -- https://master.php.net/note/delete/87142/useless
Del: bad code -- https://master.php.net/note/delete/87142/bad+code
Del: spam -- https://master.php.net/note/delete/87142/spam
Del: non-english -- https://master.php.net/note/delete/87142/non-english
Del: in docs -- https://master.php.net/note/delete/87142/in+docs
Del: other reasons-- https://master.php.net/note/delete/87142
Reject -- https://master.php.net/note/reject/87142
Search -- https://master.php.net/manage/user-notes.php