php switch

    조건문(if, if-else, elseif, switch)

    1. if if (조건) { (조건이 true일 때 실행할 코드) } 2. if-else if (조건){ (조건이 true일 때 실행할 코드) } else{ (조건이 false일 때 실행할 코드) } 3. else if if (조건) { (조건이 true일 때 실행할 코드) } elseif (조건2) { (조건2가 true일 때 실행할 코드) } elseif (조건3) { (조건3이 true일 때 실행할 코드) } ... 4. switch switch (인자) { case 조건1: 조건1에 해당될 때 실행할 코드 break; case 조건2: 조건2에 해당될 때 실행할 코드 break; case 조건3: 조건3에 해당될 때 실행할 코드 break; default: 모든 조건에 해당되지 않을 때 실행될 코..