Home  >  Article  >  Backend Development  >  php三种post数据步骤的区别

php三种post数据步骤的区别

WBOY
WBOYOriginal
2016-06-13 13:23:21678browse

php三种post数据方法的区别

php三种post数据方法Curl、socket、file_get_contents 有什么区别

三种方法都要加上 stream_set_blocking 才可以实现无须等待马上返回结果吗?

一般什么情况下用哪种方法,有没有人总结过的,谢啦。。

------解决方案--------------------
curl无脑
socket有脑
file_get_content+stream_context_create半脑残
stream_set_blocking是设置文件描述符非阻塞,可作用于regular files and socket streams,除非你用select+socket,否则对PHP这个语言编程没有益处,也许你期待的是stream_set_timeout。
------解决方案--------------------

探讨
1、PHP发邮件,因为发邮件需要一些时间,我要的效果是无须得到返回结果,马上提示用户已发送成功。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn