php post请求

public function file_get_contents_post($url, $post){
  $options = array(
    'http'=> array(
      'method'=>'POST',
      'content'=> http_build_query($post),
    ),
  );
  $result = file_get_contents($url,false, stream_context_create($options));
  return $result;
}

file_get_contents_post($_SERVER['HTTP_HOST']."/Admin/RisManager", array('LocalName'=>$basic_user['real_name']));

posted @ 2018-01-29 10:26  让双脚&去腾空  阅读(108)  评论(0编辑  收藏  举报