채택완료

함수관련 질문

2015-02-27 (금) 14:28:13 3,572

테이블마다 다른 좌측메뉴를 보여주기 위해 아래처럼 불러오고 있는데요

게시판도 워낙에 많고 복잡하다 보니

밑의 if문을 함수로 묶어서 쓸 수는 없나 이것저것 해보다 안되서 질문올립니다.

묶어서 <?=$lnb9?>  뭐 이렇게 볼 수 있게요

Copy
<?php if (($bo_table == "board_01"||$bo_table == "board_02"||$bo_table == "board_03"||$bo_table == "board_04"||$bo_table == "board_05"||$bo_table == "board_06"||$bo_table == "board_07"||$bo_table == "board_08"||$bo_table == "board_09"||$bo_table == "board_10")) { ?><? include "../lnb9.html" ?>~~~
|

답변 3개

채택된 답변
+20 포인트

드래곤된다님 또는 슈와이님 답변처럼 하시면 되구요

아니면 게시판그룹으로 구분해도 됩니다.

그룹1(group1) , 그룹2(group2) 등으로 나누고

if($gr_id == 'group1') {

    include "../lnb9.html";

} 

if($bo_table){

$depth1=$group['gr_id'];

$depth2=$board['bo_table'];

}

2015-02-27 (금) 14:46:18

$boards = array("board_01","board_0​2","board_0​3".....);

 

if(inarray($bo_table, $boards)){

include "../lnb9.html";

}

답변을 작성하려면 로그인이 필요합니다.