Am very new to php. I have the following php echo statements:
<p><?php echo $row_cv['institucion']; ?></p>
<p><?php echo $row_cv['department']; ?></p>
<p><?php echo $row_cv['department2']; ?></p>
<p><?php echo $row_cv['address']; ?></p>
<p><?php echo $row_cv['city']; ?>, <?php echo $row_cv['country']; ?>. <?php echo $row_cv['postalcode']; ?></p>
How can a write a statement that in the case that there is no department or department2 that it wouldn't leave a blank line, that everything would move "up", so to speak.
Thanks for your help.
echo statements to leave no blank lines
Moderator: General Moderators
- andre_c
- Forum Contributor
- Posts: 412
- Joined: Sun Feb 29, 2004 6:49 pm
- Location: Salt Lake City, Utah
do this for each one:
Code: Select all
<?
if ($row_cv['institution']!='') echo "<p>$row_cv[institution]</p>\n";
?>