note 93848 added to language.types.array
| From: | Anonymous at osu1 dot php dot net | Date: | Fri, 02 Oct 2009 23:33:31 +0000 |
| Subject: | note 93848 added to language.types.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-161241@lists.php.net to get a copy of this message | ||
This is a modification of a function like this which works with two dimensional arrays. Pass a 2d
array to this function and my function will return an array of the arrays with the specified
key-value pair (specified by $key and $value).
<?php
function seekKey($array, $key, $value)
{
$ret = array();
for ($i=0;$i<count($array);$i++)
{
if ($array[$i][$key]==$value)
$ret[] = $array[$i];
}
return $ret;
}
?>
----
Server IP: 209.41.74.194
Probable Submitter: 69.142.233.248
----
Manual Page -- http://www.php.net/manual/en/language.types.array.php
Edit -- https://master.php.net/note/edit/93848
Del: integrated -- https://master.php.net/note/delete/93848/integrated
Del: useless -- https://master.php.net/note/delete/93848/useless
Del: bad code -- https://master.php.net/note/delete/93848/bad+code
Del: spam -- https://master.php.net/note/delete/93848/spam
Del: non-english -- https://master.php.net/note/delete/93848/non-english
Del: in docs -- https://master.php.net/note/delete/93848/in+docs
Del: other reasons-- https://master.php.net/note/delete/93848
Reject -- https://master.php.net/note/reject/93848
Search -- https://master.php.net/manage/user-notes.php