- foreach ($array as $subArray) {
- // Search recursive and merge again
- $results = merge_array($results, search_array($subArray, $key, $value));
+ foreach ($array as $idx => $dummy) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',value=' . $value . ',idx=' . $idx);
+ // Is dummy an array?
+ if (is_array($dummy)) {
+ // Then search again
+ $subResult = search_array($dummy, $key, $value, $idx);
+ //* DEBUG: */ print 'subResult=<pre>' . print_r($subResult, TRUE).'</pre>';
+
+ // And merge both
+ $results = merge_array($results, $subResult, TRUE);
+ } elseif ((isset($array[$key])) && ($array[$key] == $value)) {
+ // Is found, so add it
+ $results[$parentIndex] = $array;
+ }