diff --git a/twe/lib.php b/twe/lib.php index a3862b3f..ce698fb0 100644 --- a/twe/lib.php +++ b/twe/lib.php @@ -252,6 +252,14 @@ function LogText($prefix, $variable){ fclose($fp); } +function dict_map($callback, $dict){ + $result = []; + foreach(array_keys($dict) as $key){ + $result[$key] = ($callback)($dict[$key]); + } + return $result; +} + function ArrayToDict($arr, $keyName){ $result = [];