From f06a4e532e109b8800d32be7581f801f857f0e86 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Tue, 10 May 2022 02:37:50 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20convertTupleArrayToDict=20=EC=9C=A0?= =?UTF-8?q?=ED=8B=B8=EB=A6=AC=ED=8B=B0=20=ED=95=A8=EC=88=98=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sammo/Util.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/sammo/Util.php b/src/sammo/Util.php index 249d1c02..2fe312cc 100644 --- a/src/sammo/Util.php +++ b/src/sammo/Util.php @@ -306,6 +306,15 @@ class Util extends \utilphp\util return $result; } + public static function convertTupleArrayToDict($arr){ + $result = []; + foreach($arr as $val){ + $key = array_shift($val); + $result[$key] = $val; + } + return $result; + } + public static function convertDictToArray($dict, bool $withKey=true) { $result = [];