- What are the differences between the two?
- Which is the most appropriate to get
htmlfrom a url to then analyze the
The code I used is this:
$html = file_get_contents($urlFlujo, false, $context);
$ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $html = curl_exec($ch); curl_close($ch);
They perform the same function as obtaining an html from an url, but I am not clear that they work in the same way or serve exactly the same.
I ask only empirical and demonstrable data of which form is the most appropriate (shorter execution time, less consumption of resources, etc.) for my case.