Bug #12741 Updated: Array needle support for array search

From: Date: Fri, 31 Aug 2001 03:36:57 +0000
Subject: Bug #12741 Updated: Array needle support for array search
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-64763@lists.php.net to get a copy of this message
ID: 12741 Updated by: andrei Reported By: nathan@cjhunter.com Old Status: Assigned Status: Closed Bug Type: Feature/Change Request Operating System: Linux 2.2 PHP Version: 4.0.5 Assigned To: andrei New Comment: Implemented in CVS. Previous Comments: ------------------------------------------------------------------------ [2001-08-14 11:12:20] nathan@cjhunter.com I am requesting that the functions in_array and array_search support an array type for their needle arguments. This feature would allow these functions to search for an array in an array of arrays. i.e. <? $needle = array(3,4); $haystack = array( array(1,2), array(3,4), array(5,6) ); if(in_array($needle, $haystack)){ echo "Yes"; }else{ echo "No"; } ?> Outputs: Warning: Wrong datatype for first argument in call to in_array in test.phtml ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=12741&edit=1

« previous php.dev (#64763) next »