php - echo html only if the variable is not empty -
i trying print content of variable , <hr>
tag after doing check if variable not empty. <hr>
getting echoed if variable empty.
here have
<?php if (!empty($content['relationship_graph'])){ print render($content['relationship_graph']); echo '<hr>'; } ?>
not pro in php looked @ documentation...cant seem figure out might doing wrong
value in blank space.
try..
<?php if(!empty($content['relationship_graph']) && $content['relationship_graph']!=''){ print render($content['relationship_graph']); echo '<hr>'; } ?>
Comments
Post a Comment