Replace the implementation of file_get_contents with curl!
The code is as follows:
//$data1 = file_get_contents(http://bbs.chengdu.cn/i_index_newdata.php?fids=202,238,239,240,241,242,259,271);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,http://bbs.chengdu.cn/i_index_newdata.php?fids=202,238,239,240,241,242,259,271);
curl_setopt($ch, CURLOPT_RETURNTTransfer, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 50);
$data1 = curl_exec($ch);
curl_close($ch);
Since the content of the remote file is read, I finally decided to use curl to replace the file_get_contents, and the feeling speed and stability have increased. During this period, the update button cannot be updated, and finally through: curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 50); to solve this problem!
