jeudi 5 mars 2015

php foreach statement to pull images, if none found replace with holding image

I am trying to run the following foreach on some images and it doesn't like my statement:





<?php foreach ($images as $image) {
if (count($images) > 1) {
'<img src="'.$image.'" class="slide">
<a href="#" class="zoom"><i class="icon-popup"></i></a>'
} else {
'<img class="slide" src="no-image-large.jpg">';
}
endforeach ?>



Being a non-php guru, where have I gone wrong?


Aucun commentaire:

Enregistrer un commentaire