Skip to content

Instantly share code, notes, and snippets.

@regepan
Last active June 2, 2021 07:30
Show Gist options
  • Save regepan/2e7d9c6a5ef57ac55e41d4332d7bf449 to your computer and use it in GitHub Desktop.
Save regepan/2e7d9c6a5ef57ac55e41d4332d7bf449 to your computer and use it in GitHub Desktop.
// --------------------------------------------------
//
// --------------------------------------------------
const DEVELOPMENT_HOST = array(
    "192.168.33.10",
    "localhost",
);

// --------------------------------------------------
//
// --------------------------------------------------
function isDevelopment() {
    for ( $i = 0; $i <= count( DEVELOPMENT_HOST ); $i ++ ) {
        if ( strpos( $_SERVER["HTTP_HOST"], DEVELOPMENT_HOST[ $i ] ) !== false ) {
            return true;
        }
    }

    return false;
}

// --------------------------------------------------
//
// --------------------------------------------------
if ( isDevelopment() ) {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment