简体   繁体   中英

Whether simple_html_dom.php uses cURL?

i want to know whether simple_html_dom.php (http://simplehtmldom.sourceforge.net/manual.htm) uses cURL or not. I have a website in which i am using simple_html_dom.php to fetch data, my current hosting provider have enabled simple_html_dom.php when i asked for. But now i want to change my hosting provider because of some economical reason. I have found another webhosting provider which allows curl functions (shown in their website); i called them and asked but they told they are not sure of simple_html_dom.php because no one has asked before. can you tell me whether simple_html_dom.php can be used in a cURL enabled server or not?.

Please forgive me if i asked a wrong questions..i have never done dom programming..i am using simple_html_dom.php because its easy and i dont have to worry about dom.

Advance thanks for your help

Yes of course you can use Simple HTML Dom on cURL enabled server. The two are totally different things. Example:


$curl = curl_init(); 
curl_setopt($curl, CURLOPT_URL, 'http://????????');  
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);  
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);  
$str = curl_exec($curl);  
curl_close($curl);  

$html= str_get_html($str); 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM