note 58913 deleted from ref.array by levim
| From: | levim@php.net | Date: | Tue, 06 May 2014 22:02:35 +0000 |
| Subject: | note 58913 deleted from ref.array by levim | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-199449@lists.php.net to get a copy of this message | ||
Note Submitter: stalker at ruun dot de
----
I had some problems while selecting sub-arrays from multi-dimensional arrays (like the SQL-WHERE
clause), so i wrote the following function:
<?php
function selectMultiArray($__multiarray,$__key,$__value) {
foreach($__multiarray as $multipart) {
if($multipart[$__key] == $__value) {
$__return[] = $multipart;
}
}
if(empty($__return)) {
return FALSE;
}
return $__return;
}
?>
hope someones finding this helpful. If you have better was for getting to this, please answer.
greets,
St4Lk3R