내가 ternerary 연산자를 사용하여 조건을 만들려고하고 오류에 대한 종료올바른 삼항 조건 IF에 대한의 ElseIf 조건
if(isset($row['content']) && strlen($row['content'])) {
$content = $row['content'];
}
elseif(isset($row['description']) && strlen($row['description'])) {
$content = $row['description'];
}
내 경우에는 else 문입니다 : 여기 내 ternerary 상태입니다
$content = isset($row['content']) && strlen($row['content']) ? $row['content'] : isset($row['description']) && strlen($row['description']) ? $row['description'] : '';
올바른 진술은 무엇입니까?
'이 (가) 오류로 종료되었습니다 ...'... 정확히 무슨 오류가 있습니까? 또한 3 진 연산자는 추가적인 이점을 추가하지 않습니다 (논쟁의 여지가 있지만 매우 작고 간결하지 않은 경우). if/else 문은이 경우 훨씬 더 읽기 쉽습니다. –
오류 유형이 "알림"이고 "정의되지 않은 색인 : 설명"입니다. – mrN