I'm a total newbie with php. I'm returning some variables for an address and am checking to see if an address2 exists. If it's null, I want it to skip and not put an extra line in the formatting. But, it seems to be breaking the line anyway. I've experimented with break tags all over the place and not, but can't find where it's coming in.
echo "$comp_name<br>$comp_add1";
if (isset($comp_add2)) {
echo "<br>$comp_add2"; }
echo "<br>$comp_city, $comp_state $comp_zip<br><a href=\"http://$comp_url\" >$comp_url</a>";
Take a look at this page: http://projects.ekcetera.com/people.php ... click on ABC Company, then check A Simplified Life, you'll see the extra line break in A Simplified Life.
What am I missing?
in A Simplified Life your $comp_add2 is set , you must check is it null or not
echo "$comp_name<br>$comp_add1";
if (!empty($comp_add2)) {
echo "<br>$comp_add2"; }
echo "<br>$comp_city, $comp_state $comp_zip<br><a href=\"http://$comp_url\" >$comp_url</a>";