Skip to content

Instantly share code, notes, and snippets.

@jsjohnst
Created December 15, 2011 02:23
Show Gist options
  • Save jsjohnst/1479547 to your computer and use it in GitHub Desktop.
Save jsjohnst/1479547 to your computer and use it in GitHub Desktop.
switch(true) {
case $http_code >= 200 && $http_code < 300:
// success!
break;
case $http_code >= 500 && $http_code < 600:
// server errpr
break;
case $http_code == 403:
// denied
break;
case $http_code == 401:
// bad signature
break;
case $http_code == 405:
// wrong method
break;
default:
// got something we didn't expect
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment