note 123348 added to function.array-uintersect
| From: | rob dot c dot ruiz at gmail dot com | Date: | Thu, 15 Nov 2018 23:21:26 +0000 |
| Subject: | note 123348 added to function.array-uintersect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-209714@lists.php.net to get a copy of this message | ||
When trying to do a case insensitive comparison between arrays of words, the strcasecmp function
works very nicely with this one like so:
$arr1 = array('blue', 'green', 'red');
$arr2 = array('BLUE', 'Purple', 'Red');
$loose_matches = array_uintersect($arr1, $arr2, 'strcasecmp');
print_r($loose_matches) // array('blue', 'red');
----
Server IP: 208.43.231.9
Probable Submitter: 98.142.89.4
----
Manual Page -- http://php.net/manual/en/function.array-uintersect.php
Edit -- https://master.php.net/note/edit/123348
Del: integrated -- https://master.php.net/note/delete/123348/integrated
Del: useless -- https://master.php.net/note/delete/123348/useless
Del: bad code -- https://master.php.net/note/delete/123348/bad+code
Del: spam -- https://master.php.net/note/delete/123348/spam
Del: non-english -- https://master.php.net/note/delete/123348/non-english
Del: in docs -- https://master.php.net/note/delete/123348/in+docs
Del: other reasons-- https://master.php.net/note/delete/123348
Reject -- https://master.php.net/note/reject/123348
Search -- https://master.php.net/manage/user-notes.php