Say I’m doing the following:
if (foo):
echo 'foo';
echo ' | ';
elseif (bar):
echo 'bar';
echo ' | ';
elseif (baz):
echo 'baz';
echo ' | ';
endif;
echo 'something else';
I’d like to avoid repeating the echo ' | '; line, but perform it when any of the conditions is true, and not if they aren’t. What’s the most efficient way to do this?
1 Answer