array( 'method' => 'POST', 'header' => 'Content-type:application/x-www-form-urlencoded', 'content' => $postdata, 'timeout' => 15 * 60 // 超时时间(单位:s) ) ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); return $result; } /** * 构造自动提交表单 * @param array $params * @param string $action * @return string */ public static function createHtml($params, $action) { $encodeType = isset ($params ['encoding']) ? $params ['encoding'] : 'UTF-8'; $html = <<
eot; foreach ($params as $key => $value) { $html .= " \n"; } $html .= <<--> eot; return $html; } }