좌측메뉴 인클루드 문의드립니다. 정보
좌측메뉴 인클루드 문의드립니다.본문
안녕하세요.
게시판 별로 아래 소스를 이용하여 좌측메뉴 html을 불러오고 있습니다.
혹시 이 소스를 if($bo_table=="test1_1,test1_2,test1_3"){ //1
이런 형태로 조금 짧게 줄일 수 있는 방법이 없을까요?
답변 부탁드립니다.
<?
if($bo_table=="test1_1"){ //1
include_once("$g4[path]/inc/left_menu1.html");
}
if($bo_table=="test1_2"){ //1
include_once("$g4[path]/inc/left_menu1.html");
}
if($bo_table=="test1_3"){ //1
include_once("$g4[path]/inc/left_menu1.html");
}
if($bo_table=="test1_4"){ //1
include_once("$g4[path]/inc/left_menu1.html");
}
if($bo_table=="test1_5"){ //1
include_once("$g4[path]/inc/left_menu1.html");
}
?>
게시판 별로 아래 소스를 이용하여 좌측메뉴 html을 불러오고 있습니다.
혹시 이 소스를 if($bo_table=="test1_1,test1_2,test1_3"){ //1
이런 형태로 조금 짧게 줄일 수 있는 방법이 없을까요?
답변 부탁드립니다.
<?
if($bo_table=="test1_1"){ //1
include_once("$g4[path]/inc/left_menu1.html");
}
if($bo_table=="test1_2"){ //1
include_once("$g4[path]/inc/left_menu1.html");
}
if($bo_table=="test1_3"){ //1
include_once("$g4[path]/inc/left_menu1.html");
}
if($bo_table=="test1_4"){ //1
include_once("$g4[path]/inc/left_menu1.html");
}
if($bo_table=="test1_5"){ //1
include_once("$g4[path]/inc/left_menu1.html");
}
?>
댓글 전체
<?
if($bo_table=="test1_1" || $bo_table=="test1_2" || $bo_table=="test1_3" || $bo_table=="t
est1_4" || $bo_table=="test1_5"){ // 1 또는 2....
include_once("$g4[path]/inc/left_menu1.html");
} else if($bo_table=="test1_6"){
include_once("$g4[path]/inc/left_menu6.html"); // 6
} else {
include_once("$g4[path]/inc/left_mene0.html"); // 나머지
}
?>
if($bo_table=="test1_1" || $bo_table=="test1_2" || $bo_table=="test1_3" || $bo_table=="t
est1_4" || $bo_table=="test1_5"){ // 1 또는 2....
include_once("$g4[path]/inc/left_menu1.html");
} else if($bo_table=="test1_6"){
include_once("$g4[path]/inc/left_menu6.html"); // 6
} else {
include_once("$g4[path]/inc/left_mene0.html"); // 나머지
}
?>
감사합니다. 잘돼요!