note 38873 added to function.in-array

From: Date: Fri, 09 Jan 2004 17:10:50 +0000
Subject: note 38873 added to function.in-array
Groups: php.notes 
Request: Send a blank email to php-notes+get-63215@lists.php.net to get a copy of this message
"duerra at nospam dot yahoo dot com"'s function looked really useful but doesn't actually work. I've corrected it here. function in_multi_assoc_array($search, $array, $key) { foreach($array AS $tmpkey=>$tmpvalue) { if($tmpkey == $key) if($tmpvalue == $search) return true; if(is_array($tmpvalue)) if (in_multi_assoc_array($search, $tmpvalue, $key)) return true; } return false; } ---- Manual Page -- http://www.php.net/manual/en/function.in-array.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+38873 Delete -- http://master.php.net/manage/user-notes.php?action=delete+38873&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+38873&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#63215) next »