<?php class backTread extends \Thread { public $data; public $i; public function __construct($data,$i){ $this->data=$data; $this->i=$i; } public function run(){ $data=$this->data; $i=$this->i; if($i==0){ $this->sendPostReturnDataYue($data); } if($i==1){ $this->sendPostReturnDataYueimg($data); } } public function sendPostReturnDataYue($row){ $data=array( 'comic' => json_encode($row), ); $url='http://www.diditoon.com/cronReceiveOcrUpdataDataYue'; $res=$this->httpPost($url,$data); echo $res;exit; } public function httpPost($uri, $data) { //初始化 $ch = curl_init (); //各种项设置,网上参考而来,可以查看php手册,自己设置 curl_setopt ( $ch, CURLOPT_URL, $uri ); curl_setopt ( $ch,
php多线程调用
最新推荐文章于 2023-01-04 16:14:49 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)