Change UI and code payment gateway audit

This commit is contained in:
Ibnu Maksum
2024-08-07 09:51:37 +07:00
parent cf04a50c35
commit 3c218d9ec9
4 changed files with 127 additions and 97 deletions

View File

@ -83,4 +83,30 @@ class Text
return $datalimit;
}
}
// echo Json array to text
public static function jsonArray2text($array, $start = '', $result = '')
{
foreach ($array as $k => $v) {
if (is_array($v)) {
$result .= self::jsonArray2text($v, "$start$k.", '');
} else {
$result .= "$start$k = " . strval($v) . "\n";
}
}
return $result;
}
public static function jsonArray21Array($array){
$text = self::jsonArray2text($array);
$lines = explode("\n", $text);
$result = [];
foreach($lines as $line){
$parts = explode(' = ', $line);
if(count($parts) == 2){
$result[trim($parts[0])] = trim($parts[1]);
}
}
return $result;
}
}