-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Issue
There is a need for an "array search path" that can be used to navigate the original array.
Solution
- Investigate if this can be integrated into the WorkerArrayStringFinder Class
The example below can be adapted to complete this functionality.
if(is_array($array) && count($array) > 0) {
foreach($array as $key => $value) {
$temp_path = $id_path;
// Adding current key to search path
array_push($temp_path, $key);
// Check if this value is an array
// with atleast one element
if(is_array($value) && count($value) > 0) {
$res_path = self::searchUsingKeyAndValue(
$search_value, $value, $temp_path);
if ($res_path != null) {
return [$res_path];
}
}
else if($value == $search_value) {
return [join(" --> ", $temp_path)];
}
}
}
return [];
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request