开发者

if else does not work

i have problem with if else statement in zend framework

<?php if(count($this->result) > 0) {
echo "not found";
}
else{ 
echo "advertise here";
}
?>

i开发者_JAVA技巧 would like to hide ads if there is no result, somehow, it does not work, please help


I'm not sure if I've understood the question correctly. But try

<?php 
 if(count($this->result) > 0) {
  echo "advertise here";
 }else{ 
  // do nothing..effectively hiding.
 }
?>

You can also get rid of the else part completely.


Your if else statement seems to be correct. Did you try to check the content of your variable with a

var_dump($this->result)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜