Re: Avoiding blank lines in HTML when field is empty

From: Date: Thu, 23 Oct 2003 18:43:53 +0000
Subject: Re: Avoiding blank lines in HTML when field is empty
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-167334@lists.php.net to get a copy of this message
Robb, You pretty much have it.. Here is what you will most likely want: <?php if (!empty($row_rsVandyDivAddresses['Address']) && strlen (trim ($row_rsVandyDivAddresses['Address'])) > 0) { echo $row_rsVandyDivAddresses['Address']) . '<br>'; } ?> Feel free to format as you wish. Jordan S. Jones Robb Kerr wrote:
I'm a PhP /MySQL newbie so please excuse the simple question. I'm returning results from a MySQL query on a webpage. My code includes... [snip]
I've tried...
     <?php if (!empty($row_rsVandyDivAddresses['Address']) echo
$row_rsVandyDivAddresses['Address']); ?> but don't know how to include the line break <br> in the if statement. Any help is greatly appreciated, Robb
-- I am nothing but a poor boy. Please Donate.. https://www.paypal.com/xclick/business=list%40racistnames.com&item_name=Jordan+S.+Jones&no_note=1&tax=0&currency_code=USD

« previous php.general (#167334) next »