Ok the below information works im just trying to figure my problem is that if
that it displays like this
but i want to put a | inbetween like this
title | grade.
my below code works but if there is no grade it still echos the |,
how can i get it to only echo when there is a value in that field.
because when the field is empty it shows
<span><?php echo $title; ?> <?php echo '|', $grade; ?></span>
You can use a ternary operator:
<span><?php echo $title; ?> <?php echo $grade ? '|' . $grade : ''; ?></span>