fetch data from live website curl php

Solutions on MaxInterview for fetch data from live website curl php by the best coders in the world

showing results for - "fetch data from live website curl php"
Giacomo
02 Sep 2019
1// Initialize Curl 
2 $curl = curl_init();
3 curl_setopt($curl, CURLOPT_URL, "https://coinmarketcap.com/"); // set live website where data from
4 curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); // default
5 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); // default
6 $content = curl_exec($curl);
7
8 preg_match_all('!<p color="text3" class="sc-AxhUy bzeXdk coin-item-symbol" font-size="1">(.*?)</p>!', $content, $matches);
9
10 var_dump($matches);