PHP - if value is null or empty, do this

0 votes
169 views
added Aug 19, 2021 in PHP by lcjr First Warrant Officer (11,850 points)
<?php
  if($nid == 1860554) {
    echo '<h4><span style=""><img src="media/logo.png"></span></h4>';
  }
  else { 
    if (empty($field_slogan)) {
      echo "";
    }
    else {
      echo "<h4>" . $field_slogan . "</h4>"; 
    } 
  }
?> 

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...