I'm trying to get the output of URL headers and it works great with a subdomain example
subdomain.example.com
I will get the normal message HTTP 200 ok etc, but if the subdomain has -
in it nothing is displayed in the headers.
-test.tumblr.com
or test-.tumblr.com
Is there a better way of doing this? My example code is below.
$url = "http://-test.tumblr.com";
$url_headers = @get_headers($url);
$urlheader = $url_headers[0];
echo $urlheader;
If it cannot be done with checking the headers how else would I go about seeing if the page exists. I have tried using curl but it does the same.
Thanks