Send HTTP request from PHP without waiting for response?

后端 未结 10 938
温柔的废话
温柔的废话 2020-12-08 00:25

I want to have an HTTP GET request sent from PHP. Example:

http://tracker.example.com?product_number=5230&price=123.52

The idea is to d

10条回答
  •  误落风尘
    2020-12-08 01:04

    array(
        'method'=>"GET",
        'header'=>"Accept-language: en" 
      )
    );
    
     $context = stream_context_create($opts);
    
    // Open the file using the HTTP headers set above
    $file = file_get_contents('http://tracker.example.com?product_number=5230&price=123.52', false, $context);
    ?>
    

提交回复
热议问题