PHP Function HTTP Status Code Value as String

I’ve been working with the php CURL library and found that it would not return an error if the server returned a 500 error. After looking up 3 different status codes that I wasn’t very familiar with, I created the following function. It is very complete and includes additional WebDAV, Apache and Microsoft codes.

function http_status_code_string($code, $include_code=false)
	// Source:

	switch( $code )
		// 1xx Informational
		case 100: $string = 'Continue'; break;
		case 101: $string = 'Switching Protocols'; break;
		case 102: $string = 'Processing'; break; // WebDAV
		case 122: $string = 'Request-URI too long'; break; // Microsoft

		// 2xx Success
		case 200: $string = 'OK'; break;
		case 201: $string = 'Created'; break;
		case 202: $string = 'Accepted'; break;
		case 203: $string = 'Non-Authoritative Information'; break; // HTTP/1.1
		case 204: $string = 'No Content'; break;
		case 205: $string = 'Reset Content'; break;
		case 206: $string = 'Partial Content'; break;
		case 207: $string = 'Multi-Status'; break; // WebDAV

		// 3xx Redirection
		case 300: $string = 'Multiple Choices'; break;
		case 301: $string = 'Moved Permanently'; break;
		case 302: $string = 'Found'; break;
		case 303: $string = 'See Other'; break; //HTTP/1.1
		case 304: $string = 'Not Modified'; break;
		case 305: $string = 'Use Proxy'; break; // HTTP/1.1
		case 306: $string = 'Switch Proxy'; break; // Depreciated
		case 307: $string = 'Temporary Redirect'; break; // HTTP/1.1

		// 4xx Client Error
		case 400: $string = 'Bad Request'; break;
		case 401: $string = 'Unauthorized'; break;
		case 402: $string = 'Payment Required'; break;
		case 403: $string = 'Forbidden'; break;
		case 404: $string = 'Not Found'; break;
		case 405: $string = 'Method Not Allowed'; break;
		case 406: $string = 'Not Acceptable'; break;
		case 407: $string = 'Proxy Authentication Required'; break;
		case 408: $string = 'Request Timeout'; break;
		case 409: $string = 'Conflict'; break;
		case 410: $string = 'Gone'; break;
		case 411: $string = 'Length Required'; break;
		case 412: $string = 'Precondition Failed'; break;
		case 413: $string = 'Request Entity Too Large'; break;
		case 414: $string = 'Request-URI Too Long'; break;
		case 415: $string = 'Unsupported Media Type'; break;
		case 416: $string = 'Requested Range Not Satisfiable'; break;
		case 417: $string = 'Expectation Failed'; break;
		case 422: $string = 'Unprocessable Entity'; break; // WebDAV
		case 423: $string = 'Locked'; break; // WebDAV
		case 424: $string = 'Failed Dependency'; break; // WebDAV
		case 425: $string = 'Unordered Collection'; break; // WebDAV
		case 426: $string = 'Upgrade Required'; break;
		case 449: $string = 'Retry With'; break; // Microsoft
		case 450: $string = 'Blocked'; break; // Microsoft

		// 5xx Server Error
		case 500: $string = 'Internal Server Error'; break;
		case 501: $string = 'Not Implemented'; break;
		case 502: $string = 'Bad Gateway'; break;
		case 503: $string = 'Service Unavailable'; break;
		case 504: $string = 'Gateway Timeout'; break;
		case 505: $string = 'HTTP Version Not Supported'; break;
		case 506: $string = 'Variant Also Negotiates'; break;
		case 507: $string = 'Insufficient Storage'; break; // WebDAV
		case 509: $string = 'Bandwidth Limit Exceeded'; break; // Apache
		case 510: $string = 'Not Extended'; break;

		// Unknown code:
		default: $string = 'Unknown';  break;
	if( $include_code )
		return $code . ' '.$string;
	return $string;

HTTP Code values are taken from the Wikipedia entry found here:

Columbus Ohio Internet Usage Unknowningly Monitored for Profit

I just found out my Internet Service Provider (ISP) called WOW Internet and Cable has been monitoring our web traffic since March of 2008 for profit. The monitoring takes place by installing hardware made by NebuAds within the ISP’s network, WOW Internet in my case. Web traffic from WOW Internet customers (like me) is routed through these hardware devices for tracking. The data (html, javascript, images, etc…) that customers like myself request from web sites such as Google could be modified in order to display targeted advertising. According to DSLReports, WOW cable (and other NebuAds clients) can make at least $2.50 a month per customer.

I was made aware of this by a local TV station here in Columbus, Ohio.

When I spoke with WOW today, they informed me that I was recently made aware of this change when they sent me a notice in the mail of recent change in the terms of service. Like any trusting customer, I did not read the fine print. The notice did not come with a cover letter explaining what part of the notice changed and/or why. See Third Party Advertisers section of WOW Internet Terms.

Notice that in the WOW Internet Terms they created an acronym for “Personally Identifiable Information” as “PII”. The way the acronym is written in the sentence it implies that it encompasses other items. Make no mistake, they clearly state that PII is your name, address and phone number and nothing else. They do not state that IP addresses are PII. In my opinion, your IP address on the Internet is just as personally identifiable as your telephone number or street address. An IP address identifies you on the Internet so data knows where to be directed over the entire World Wide Web. The same can be said about telephone calls and snail mail. Apparently WOW does not believe that your IP address on the Internet is considered “personally identifiable information” even though IP addresses have been continually used to identify individuals and is commonly added to header information of many Internet protocols such as email and web browsing.

Users may opt out of the service on a per browser bases using cookies. This means that anytime I decide to switch from Internet Explorer to Firefox, Opera, Safari or another computer for that matter, I have to remember to follow a procedure (that I currently do not know) to add a cookie to each browser I use to turn this tracking off. Further more, I now have to do this for every computer in my home and for anyone who visits who uses my Internet. This means that browsers used in my home must support cookie handling, removing my choice (or anyone else in my home’s choice) of turning off cookies in web browsers. For 3rd party applications (Non web browsers) that use the Internet (such as to download or check for product updates) will continue to be tracked by WOW.

WOW Internet is the 12th largest Cable provider in the United States. WOW has been using NebuAds to profit from its customers since March/April of 2008. For the past three months, WOW has made more than $7 from myself alone. I have yet to see any savings passed onto my bill. It appears this $2.50 is an additional revenue stream for WOW and is not something they are using to pass savings to their customers in exchange for invading their privacy.

The 3rd largest cable provider, Charter Communications, recently decided not to use the NebuAds service to make money from its customers. Charter decided to abandon the practice following the release of a report that caught the interest of the United States Congress into the legalities of the adveritsing targeting mechanisms.

The most upsetting aspect of this whole thing for me personally, is that I’ve discovered that this tracking is known to cause problems with Google Gmail. I use Gmail and Gmail for my domains and have come to rely heavily on Google’s Gmail service. Since March I have experienced issues with Gmail and for the longest time have presumed Gmail was the problem. Now that I know that my ISP, that I’ve been paying over $100 a month to provide me reliable access to the Internet, may have been the cause of the problems I’ve been experiencing with Gmail frustrates me greatly. I’ve lost a lot of time and productivity with the problems I have had with Gmail. Email is a vital service, especially for someone who requires not only for tracking and paying bills but for employment and work as well.

I’ve called and notified WOW that they will have to contact me in 7 days to let me know that they will no longer be tracking my Internet and have stopped modifying my Internet traffic. Otherwise I will switch to another ISP. They have until July 7th to resolve this issue, or they will loose me as a customer. If after July 7th, they do not rectify this problem with their service, I will contact federal, state and local government representatives in my area of WOW’s shady practices, notify my neighbors what WOW is doing with their Internet usage, and make it a point to NOT recommend WOW for Internet services.

WOW, you have 168 hours. What is your answer?


WOW cable called me today (Thursday) at about 4pm to let me know that they are removing the NebuAds for all of their customers! I no longer need to switch ISPs! What an emotional roller coaster but unlike some businesses apparently WOW does listen to its customers. I’m going to stick with WOW now that they will no longer deploy this questionable intrusion of advertising in my web surfing.

As soon as I have a press release to link to I’ll create a new blog post about it.