From 25f679f062a9298b1f8c3222abb131f0e4836e91 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Sat, 1 Jun 2019 14:35:34 +0900 Subject: [PATCH] Update catsplit.format.php --- helper/catsplit.format.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/helper/catsplit.format.php b/helper/catsplit.format.php index d05ec98..106a24d 100644 --- a/helper/catsplit.format.php +++ b/helper/catsplit.format.php @@ -18,3 +18,26 @@ if(!check_function_exists("catsplit_encode")) { return sprintf("('%s')<=(%s)", implode("','", $_vs), implode(",", $_ks)); } } + +if(!check_function_exists("catsplit_decode")) { + function casplit_decode($data) { + $s_final = array(); + + // step 1 + $s1 = explode(")<=(", substr($data, 1, -1)); + + // step 2 + $s2a = explode(",", $s1[0]); + $s2b = explode(",", $s1[1]); + + // step 3 + $s3 = array_combine($s2b, $s2a); + + // step 4 + foreach($s3 as $k=>$v) { + $s_final[$k] = substr(stripslashes($v), 1, -1); + } + + return $s_final; + } +}