PHP异步执行的常用方式常见的有以下几种,可以根据各自优缺点进行选择:

1.客户端页面采用AJAX技术请求服务器

2.popen()函数

3.curl扩展

4.fscokopen()函数

 

这里主要介绍curl扩展的方法,因为其它几种没仔细看。

$ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_URL, $remote_server); curl_setopt($ch, CURLOPT_TIMEOUT, 1); curl_exec($ch); curl_close($ch);

参考链接

http://www.cnblogs.com/gaoxu387/archive/2011/10/26/2224740.html

http://pcwanli.blog.163.com/blog/static/45315611201291774214657/

相关文章:

  • 2021-08-17
  • 2022-12-23
  • 2022-01-04
  • 2021-08-29
  • 2021-07-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2021-07-30
  • 2022-02-27
  • 2021-10-14
相关资源
相似解决方案