From a6976d1a5672cccc3f18edbfddf58a771f556bc7 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Fri, 21 Feb 2020 14:04:42 +0900 Subject: [PATCH] Update base.php --- system/base.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/system/base.php b/system/base.php index 81d65b5..4135e52 100644 --- a/system/base.php +++ b/system/base.php @@ -315,6 +315,20 @@ if(!is_fn("check_is_empty")) { } } +if(!is_fn("get_key_in_array")) { + function get_key_in_array($val, $arr) { + return array_search($val, $arr); + } +} + +if(!is_fn("remove_item_in_array")) { + function remove_item_in_array($key, $arr) { + if(array_key_exists($key, $arr)) { + unset($arr[$key]); + } + } +} + // error handler (set error) if(!is_fn("set_error")) { function set_error($msg, $code="ERROR") {