As a part of the requirement I need to find out whether a domain is parked or not. As there is no efficient way to find out this, I'm going to check the DOM for phrases like "Buy this domain", "may be for sale".. etc.
I found some parked domains which can be accessed through browser, but cannot able to get them using file_get_contents
.
Example
$url = 'http://buythisdomain.com/'
$get = file_get_contents($url);
For the above got the following message at output.
Warning: file_get_contents(http://buythisdomain.com/): failed to open stream: HTTP request failed!
But able to access the same URL via browser.I tried fopen
method too, but same result. Is there any way to achieve this?
filestream context
as shown in @Brain's answer