'smartcost', 'templateId' => $templateId, 'msgType' => '0', 'phone' => $phone, 'vars' => $vars ); $sParamStr = ""; ksort($param); foreach ($param as $sKey => $sValue) { $sParamStr .= $sKey . '=' . $sValue . '&'; } $sParamStr = trim($sParamStr, '&'); $smskey = 'kuGmqTt10n6vBXivhxXsAuG8aoCsQ1x6'; $sSignature = md5($smskey."&".$sParamStr."&".$smskey); $param = array( 'smsUser' => 'smartcost', 'templateId' => $templateId, 'msgType' => '0', 'phone' => $phone, 'vars' => $vars, 'signature' => $sSignature ); $data = http_build_query($param); $options = array( 'http' => array( 'method' => 'POST', 'header' => 'Content-Type:application/x-www-form-urlencoded', 'content' => $data )); $context = stream_context_create($options); $result = file_get_contents($url, FILE_TEXT, $context); return $result; } ?>