Something in PHP, I want to display content if a certain variable exists.
For example, For the current comment I want to check if the author has already voted on this reply, so the code will be something as the following:
<?php if (isset($replies)): ?>
<?php foreach ($replies as $reply): ?>
<?php if (isset($already_voted)): ?>
<?php foreach ($already_voted as $vote): ?>
// if vote['id'] == $reply['id'], echo what they have already voted
<?php endforeach; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
What would be an easier way of doing this, without using a bloated templating engine like smarty?
(Please, no comments about... yes 'PHP is essentially a templating engine' or anything along those lines).