I have this code, the problem is that there is an empty space before each comma.
Name Lastname , (1990.) , Title ...
It should be
Name Lastname, (1990.), Title ...
I need to have data in this format using echo.
ob_start();
...
<?php // DATE ?>
<?php if(!empty($ref['godina_izdanja'])) :
echo ', (<span class="date">' . $ref['godina_izdanja'] . '</span>.)';
endif; ?>
<?php // TITLE?>
<?php if(!empty($ref['title'])) :
echo ', <em><span class="title">' . $ref['title'] . '</span></em>';
endif; ?>
Is there something I could do to fix it but to have code readable? I know I can concat everything together but it will become hard to read and mantain