When I execute this code:
var_dump(file_get_contents('http://www.zahnarzt-gisler.ch'));
I get this error:
Warning: file_get_contents(http://www.zahnarzt-gisler.ch): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in /home/httpd/vhosts/your-click.ch/httpdocs/wp-content/themes/your-click/ajax-request.php on line 146 bool(false)
I don't know why it is returning false, since when I change the url, e.g. http://www.google.com or any other url, it will work and returns the source code of the page.
I guess it must be something wrong with the url but it just seems weird to me, because it url is online and available.
You can just scrape the page, but you have to set a user-agent. Curl is the way to go.
file_get_contents() is a simple screwdriver. Great for simple GET requests where the header, HTTP request method, timeout, cookiejar, redirects, and other important things do not matter.