bozidar310196
New Member
- Messages
- 2
- Reaction score
- 0
- Points
- 0
Hi! My first post!
Do you see something wrong whit this piece of code?
function get_url_contents($url){
$crl = curl_init();
$timeout = 10;
curl_setopt ($crl, CURLOPT_URL,$url);
curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout);
$ret = curl_exec($crl);
curl_close($crl);
return $ret;
}
function getCont($url) {
if(trim($url)=="")
return "";
$dom = new DOMDocument();
$resp = get_url_contents($url);
$dom->loadXML($resp);
}
problem is that i'm getting something like this:
Warning: DOMDocument::loadXML() [domdocument.loadxml]: Empty string supplied as input in ...bla
On my local computer, it works perfectly.... :\
Do you see something wrong whit this piece of code?
function get_url_contents($url){
$crl = curl_init();
$timeout = 10;
curl_setopt ($crl, CURLOPT_URL,$url);
curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout);
$ret = curl_exec($crl);
curl_close($crl);
return $ret;
}
function getCont($url) {
if(trim($url)=="")
return "";
$dom = new DOMDocument();
$resp = get_url_contents($url);
$dom->loadXML($resp);
}
problem is that i'm getting something like this:
Warning: DOMDocument::loadXML() [domdocument.loadxml]: Empty string supplied as input in ...bla
On my local computer, it works perfectly.... :\