if 조건문 관련 문의

if 조건문 관련 문의

QA

if 조건문 관련 문의

답변 1

본문

제가 뭘 놓치고 있는게 있나요?

 

echo $bo_table;
echo "<br>";
 if ($bo_table = "music" or $bo_table = "youtube" or $bo_table = "gallery") {$wrnone = "";} else {$wrnone = "class=plushidden   style=display:none;float:left;margin-right:5px;";}
echo $bo_table;
 

테이블에 따라서 스타일을 다르게 적용하려고 했는데 안되서..

script라는 테이블 목록(list_skin) 상단에서 위와 같이 조건문 걸고 출력해봤더니,

 

script

music 

이렇게 출력되네요.

 

script

script 

이렇게 출력되야 하는 거 아닌가요?

 

이 질문에 댓글 쓰기 :

답변 1

if 구문의 equal comparison 은 == 로 표현합니다.

 

https://www.php.net/manual/en/language.operators.comparison.php


// if ($bo_table = "music" or $bo_table = "youtube" or $bo_table = "gallery")
 if ($bo_table == "music" or $bo_table == "youtube" or $bo_table == "gallery")
답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 0
© SIRSOFT
현재 페이지 제일 처음으로