I am using one curl function in my code that returns the html of the given url. It is working fine for all urls. but, for one url it is not fetching the data.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,1000);
$contents = curl_exec($ch);
curl_close($ch);
return $contents;
This is my curl function
My url is 'http://www.example.com/' if i pass the url like this it wont work. if i pass the url without www, then it is working. this is happening for only this particular url.