PHP else/if语句
我已经编写了下面的PHP语句,但是每次我试图将它组合成else/if时,它都会中断 有人能给点建议吗?我是PHP新手,有点困了 谢谢:)PHP else/if语句,php,if-statement,Php,If Statement,我已经编写了下面的PHP语句,但是每次我试图将它组合成else/if时,它都会中断 有人能给点建议吗?我是PHP新手,有点困了 谢谢:) /Images/mainmimages/innerPage Image.jpg“alt=”“/>/Images/mainmimages/innerPage-Image2.jpg”alt=”“/>/Images/mainmimages/innerPage-Image3.jpg“alt=”“/> /Images/mainmages/innerPage Image
/Images/mainmimages/innerPage Image.jpg“alt=”“/>/Images/mainmimages/innerPage-Image2.jpg”alt=”“/>/Images/mainmimages/innerPage-Image3.jpg“alt=”“/>
/Images/mainmages/innerPage Image.jpg“alt=”“/>/Images/mainmages/innerPage Image.jpg”alt=”“/>/Images/mainmages/innerPage Image.jpg“alt=”“/>
}
/Images/mainmimages/innerPage Image.jpg“alt=”“/>/Images/mainmimages/innerPage-Image2.jpg”alt=”“/>/Images/mainmimages/innerPage-Image3.jpg“alt=”“/>
/Images/mainmages/innerPage Image.jpg“alt=”“/>/Images/mainmages/innerPage Image.jpg”alt=”“/>/Images/mainmages/innerPage Image.jpg“alt=”“/>
以下是使用您的代码的if/else示例
<?php if (is_page(19)) { ?>
//Insert html
<? { elseif (is_page(23)) } ?>
//Insert other html
<? } ?>
//插入html
//插入其他html
使用以下语法:
<?php if (condtion):?>
// html goes here,
<?php elseif(condtion): ?>
// html goes here,
<?php endif; ?>
//html放在这里,
//html放在这里,
什么代码会中断?你是怎么做的?
不适合你?(没有?>短代码(谢谢-是缺少的})让我难堪!谢谢你关于模板目录调用的建议哦-那么我应该坚持原来的模板目录调用吗?我想我今天学到了一些东西,我总是使用短代码。谢谢!
<?php if (is_page(19)) { ?>
//Insert html
<? { elseif (is_page(23)) } ?>
//Insert other html
<? } ?>
<?php if (condtion):?>
// html goes here,
<?php elseif(condtion): ?>
// html goes here,
<?php endif; ?>