Home >Backend Development >PHP Tutorial >PHP asynchronous execution method to simulate multi-threading

PHP asynchronous execution method to simulate multi-threading

WBOY
WBOYOriginal
2016-07-25 08:54:44953browse
  1. $fp = fsockopen('localhost',80,&$errno,&$errstr,5);
  2. if(!$fp)
  3. {
  4. echo "$errstr ($errno)
    n";
  5. }
  6. fputs($fp,"GET ./test.phprn"); //The path in this place must be correct. It was wrong at the beginning
  7. fclose($fp );
Copy the code

and place the required code in test.php so that it will be executed asynchronously.



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