[ 30 => 'k-yd-30', 50 => 'k-yd-50', 100 => 'k-yd-100', 200 => 'k-yd-200', 300 => 'k-yd-300', 500 => 'k-yd-500' ], mtopcard\ChinaUnicomCard => [ 30 => 'k-lt-30', 50 => 'k-lt-50', 100 => 'k-lt-100', 200 => 'k-lt-200' ], mtopcard\ChinaTelecomCard => [ 30 => 'k-dx-30', 50 => 'k-dx-50', 100 => 'k-dx-100', 200 => 'k-dx-200' ] ]; public static function sign(array $params, array $ignore = []): string { ksort($params); $content = ''; foreach ($params as $key => $value) { if (in_array($key, $ignore)) { continue; } if(self::check_empty($value) === false) { $key = strtolower($key); $value = urlencode($value); $content .= "$key=$value&"; } } $content .= "secretkey=" . config::SECRET_KEY; return md5($content); } public static function check_empty($value): bool { if (!isset($value)) return true; if (trim($value) === "null") return true; return false; } }