View Single Post
Old 04-11-2022, 12:40 PM  
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,129
Row with no contents, how to remove in output?

So I have a table that has a row of URLs in it, some of the rows do not have any data in them.

When outputting the data to a page, how can I make it so that the code where that url should appear dissapears from the page?

This is the code I'm using:

Quote:
<strong><a href="<?php echo $One; ?>">One</a></strong> |
<strong><a href="<?php echo $Two; ?>">Two</a></strong> |
<strong><a href="<?php echo $Three; ?>">Three</a></strong> |
<strong><a href="<?php echo $Four; ?>">Four</a></strong></p>
One, Two, Three & Four are all links to our product on a specific online store, I'm thinking its something to do with either and "if" or an "echo" statement(?) but I cant seem to figure out the right code to get it working.

Basically, if the row for 'Two' has no data in it, how do i get it to just vanish from the 4 options?

So instead of:

One | Two | Three | Four

It shows:

One | Three | Four

The data calls are in an array at the top of the page if that helps any?
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote