title: PHP cURL doesn't work with - in subdomains
body: <p>I have a PHP script that I'm trying to get the contents of a page. The code im using is below</p>
  
  <pre><code>$url = "http://test.tumblr.com";
  
  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  $txt = curl_exec($ch);
  curl_close($ch);
  
  echo "$txt";
  </code></pre>
  
  <p>It works fine for me as it is now. The problem I'm having is, if I change the string URL to</p>
  
  <p><code>$url = "http://-test.tumblr.com";</code> or <code>$url = "http://test-.tumblr.com";</code></p>
  
  <p>It will not work. I understand that -test.example.com or test-.example.com is not a valid hostnames but with Tumblr they do exists. Is there a work around for this?</p>
  
  <p>I even tried creating a header redirect on another php file so cURL would be first getting a valid hostname but works the same way.</p>
  
  <p>Thank you</p>