note 16345 deleted from function.array-search by jimw

From: Date: Thu, 25 Oct 2001 23:16:08 +0000
Subject: note 16345 deleted from function.array-search by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-19451@lists.php.net to get a copy of this message
In response to kerry@lothrop.de and anyone else posting homemade array_search functions using foreach, you have defeated the purpose. The original purpose was to have a PHP3 compatible array_search function. But foreach and array_keys() are only available in PHP4. For a PHP3 compatible search function you need to use: reset($array); while(list($key,$value) = each($array)) Instead of the foreach() loop

« previous php.notes (#19451) next »