I know it's bad putting JavaScript inside PHP, but I'm rendering HTML with PHP and i want to check if row is empty and hide each of those HTML elements in a class. I know about Ajax, I just want this in PHP.
PHP:
if ($row['image1'] != ''){
echo '<script>
$(".image1Class").each(function() {
$(this).show();
});
</script>';
}