rdub Posted May 2, 2010 Share Posted May 2, 2010 I am using this code which works fine unless there is no entry in price. It then shows the $ and a zero. How can I change the code so than it shows nothing if there is no value? echo "<td width=150 valign=top>".$fetched['id']. ("<img . width=150 . src='" .$fetched['Image'] ."' /> ") . "<br />"."<span class=style1e>".$fetched['hi_lite']."</span>". "<br />".$fetched['Phone']. "<span class=style1d>".$fetched['Description']."</span>". "<br>"."<span class=style1d>"."<align=center>".$fetched['mls']."</span>". "<span class=style1e>"." "." "."$".number_format ($fetched['price'])."</span>". Link to comment https://forums.phpfreaks.com/topic/200472-dont-show-if-empty/ Share on other sites More sharing options...
Ken2k7 Posted May 2, 2010 Share Posted May 2, 2010 Use an if statement? Or a ternary? Link to comment https://forums.phpfreaks.com/topic/200472-dont-show-if-empty/#findComment-1052009 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.