note 81677 added to function.array-search

From: Date: Sun, 09 Mar 2008 16:30:46 +0000
Subject: note 81677 added to function.array-search
Groups: php.notes 
Request: Send a blank email to php-notes+get-136871@lists.php.net to get a copy of this message
This is the phpfied version of the array_search function for PHP version under 4.0.5 <?php if(!function_exists("array_search")){ function array_search( $needle, $haystack, $strict = FALSE ){ if( !is_array($haystack) )return FALSE; foreach($haystack as $key => $val){ if( ( ( $strict ) && ( $needle === $val ) ) || ( ( !$strict ) && ( $needle == $val ) ) )return $key; } return FALSE; }/* endfunction array_search */ }/* endfunction exists array_search*/ ?> ---- Server IP: 69.147.83.197 Probable Submitter: 87.120.68.77 ---- Manual Page -- http://www.php.net/manual/en/function.array-search.php Edit -- https://master.php.net/note/edit/81677 Del: integrated -- https://master.php.net/note/delete/81677/integrated Del: useless -- https://master.php.net/note/delete/81677/useless Del: bad code -- https://master.php.net/note/delete/81677/bad+code Del: spam -- https://master.php.net/note/delete/81677/spam Del: non-english -- https://master.php.net/note/delete/81677/non-english Del: in docs -- https://master.php.net/note/delete/81677/in+docs Del: other reasons-- https://master.php.net/note/delete/81677 Reject -- https://master.php.net/note/reject/81677 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#136871) next »