Home > Backend Development > PHP Tutorial > php的有关问题

php的有关问题

WBOY
Release: 2016-06-13 12:04:28
Original
958 people have browsed it

php的问题

<?php if($types[$this->type]['type']==1||$types[$this->type]['type']==2) {?><br /><ul class="kj-hao"><br />    <li class="hao1 img-bj"><?=$kjHao[0]?></li><br />    <li class="hao2 img-bj"><?=$kjHao[1]?></li><br />    <li class="hao3 img-bj"><?=$kjHao[2]?></li><br />    <li class="hao4 img-bj"><?=$kjHao[3]?></li><br />    <li class="hao5 img-bj"><?=$kjHao[4]?></li><br /></ul><br /><?php }else if($types[$this->type]['type']==3){?><br /><ul class="kj-hao hao-wid"><br />    <li class="hao1 img-bj"><?=$kjHao[0]?></li><br />    <li class="hao2 img-bj"><?=$kjHao[1]?></li><br />    <li class="hao5 img-bj"><?=$kjHao[2]?></li><br /></ul><br /><?php }?><br />
Copy after login

大神帮忙看一下此代码有没有出错   为什么页面显示不出来=$kjHao[0]?>这个函数
------解决方案--------------------
可能没有打开短标签
改成  echo $kjHao[0];?>试试看
------解决方案--------------------
是沒有啟用短tag的原因
解決方法
1.進入php.ini,將short_open_tag 設為  On ,short_open_tag = On
2.不使用短tag,只使用 echo $kjHao[0] ; ?> 這樣的

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template