채택완료

get_selected($sfl, 'wr_1', true) true 는 무슨 의미인가요?

2015-03-30 (월) 16:39:45 5,845

get_selected($sfl, 'wr_1', true)

제목검색에 있길래 그대로 복사했는데 true 는 어떤역활인가요? 

|

답변 3개 / 댓글 1개

채택된 답변
+20 포인트

true는 없어야 됩니다

잘못된 코드입니다

get_selected($sfl, 'wr_content')는 if($sfl == wr_content){selected='selected'} 이런 뜻이겠죠?

함수가 이렇게 되있는거 보니

function get_selected($field, $value)
{
    return ($field==$value) ? ' selected="selected"' : '';
}
​

2015-03-30 (월) 17:04:07

get_selected($sfl, 'wr_1', true) true

선택된 값이 wr_1 이 맞다면

머 이른뜻... 

답변에 대한 댓글 1개

<option value="wr_subject"<?php echo get_selected($sfl, 'wr_subject', true); ?>>제목</option>
<option value="wr_content"<?php echo get_selected($sfl, 'wr_content'); ?>>내용</option>
제목에만 있고 나머지는 true가 없는데 어떤차이인가요...?

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