deepak-rajpal
12/5/2017 - 8:07 AM

Check if variable is empty or not

condition: whitespace should not be counted & 0 is also content

<?php if(strlen(trim($service_category->description))> 0 ) { 
 echo $service_category->description;
 } ?>
 
<?php if(strlen(trim($service_category->description))) { 
 echo $service_category->description;
 } ?>