|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-12-09 16:48 UTC] Hast4656 at gmail dot com
Description:
------------
Can you please add parameter for in_array that let this function to compare
strings insensitive?
Test script:
---------------
// something like
in_array('a', Array('a', 'A'), true, true);
// 4th bool param says should the function compare string in a case-sensitive manner or not
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 20:00:01 2025 UTC |
How about adding a comparitor callback then? Maybe even overload the third argument (e.g. if it's not a boolean, then assume callback), so we can do something like: in_array('a', array('A', 'b'), function($a, $b) { return !strcasecmp($a, $b); });