1, mtopcard\ChinaUnicomCard => 2, mtopcard\ChinaTelecomCard => 3 ]; const ExtHeaders = ['Content-Type: application/json;charset=UTF-8']; public static function sign($params) { ksort($params); $content = ''; foreach ($params as $key => $value) { if(self::check_empty($value) === false) { $content .= "{$key}={$value}&"; } } $content .= 'appSecret='.config::APP_SECRET; return md5($content); } public static function check_empty($value) { if (!isset($value)) return true; if ($value === null) return true; if (trim($value) === "") return true; return false; } }