开发者

if else does not work

开发者 https://www.devze.com 2023-01-14 18:45 出处:网络
i have problem with if else statement in zend framework <?php if(count($this->result) > 0) { echo \"not found\";

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

精彩评论

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

关注公众号