Evaluating HTTP Responses in PHP

Sometime it is valuable to check the HTTP response of a HTTP-request for quality and service availability assurance. The following code returns the headers given in response to a HTTP-request.

The following code opens a socket connection to a hostname or IP address (mandatory argument) and sends the request (mandatory argument). After that it returns the HTTP response code as a string.

The source code is well commented.

The example output would look like this:

HTTP/1.1 404 Not Found

11 Responses to “Evaluating HTTP Responses in PHP”

  1. プログラマー's 雑録 Says:

    ファイル読込み…

    $fp = fopen(’ファイル名’, ‘r’); if(!$fp) {     printf(”ファイルのオープンに失敗しました。\n”);     return; } while(!feof($fp)) {   &…

  2. Afterlife(69) Says:

    Heh, I actually wrote a tutorial on this a while ago on a forum I manage (haven’t touched it in ages now, but heres a link: http://panicatthesyntax.com/showthread.php?t=67).

  3. Troshichev Says:

    http://landbest.info/replica-watches/rolex-day-date-watches.php

  4. toon bdsm Says:

    toon bdsm…

    Title of toon bdsm…

  5. nude picture of asian women Says:

    nude picture of asian women…

    Relevant information about nude picture of asian women….

  6. aunt judy bondage story Says:

    aunt judy bondage story…

    Advantages of aunt judy bondage story….

  7. real-pain nazi bdsm Says:

    real-pain nazi bdsm…

    The best of real-pain nazi bdsm….

  8. meet lesbian free Says:

    meet lesbian free…

    Advantages of meet lesbian free….

  9. shota hentai Says:

    shota hentai…

    Title of shota hentai…

  10. igmlo Says:

    Valentine card s

  11. jesng Says:

    Trampoline games

Leave a Reply