//ローカルのテスト環境かどうか function is_local_test(){ $host = $_SERVER['SERVER_NAME']; if ( $host == 'localhost' || $host == '127.0.0.1' ) { return true; } }