title: Getting header response code
body: <p>This is part of a PHP script I am putting together.  Basically a domain ($domain1) is defined in a form and a different message is displayed, based on the response code from the server.  However, I am having issues getting it to work.  The 3 digit response code is all I am interested in.  </p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>function get_http_response_code($domain1) {
      $headers = get_headers($domain1);
      return substr($headers[0], 9, 3);
      foreach ($get_http_response_code as $gethead) { 
          if ($gethead == 200) {
              echo "OKAY!";
          } else {
              echo "Nokay!";
          }
      }
  }
  </code></pre>