📜  从实时网站 curl php 代码示例中获取数据

📅  最后修改于: 2022-03-11 14:53:53.341000             🧑  作者: Mango

代码示例1
// Initialize Curl 
 $curl = curl_init();
 curl_setopt($curl, CURLOPT_URL, "https://coinmarketcap.com/"); // set live website where data from
 curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); // default
 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); // default
 $content = curl_exec($curl);

 preg_match_all('!

(.*?)

!', $content, $matches); var_dump($matches);