cororon Posted January 22, 2008 Share Posted January 22, 2008 HiI have some code that displays event listings.If any of the fields like $row['event_artist'] or $row['event_detail'] or $row['event_contact'] are blank or NUll I get a blank line (because of the <br />). Is there a way I can easily get around that without having to put in IF/ELSE statements to check if the fields is blank and then using different code?echo $row['event_name'] . "<br> " . $row['event_start_time'] . $row['event_venue'] . "<br />" . $row['event_artist'] . "<br />" . $row['event_detail'] . "<br />" . $row['event_contact'] . "<br><br>"; Many thanks Link to comment Share on other sites More sharing options...
Matpatnik Posted January 22, 2008 Share Posted January 22, 2008 you can do an if statement to filter your variable, something like this: if ($row['event_name'] != '') { $row['event_name'] = $row['event_name'] .'<br />';}... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.