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

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -