0

Hi all,

So I would like a else statement that would go like this:

<?php
if ($image=="none")
echo "no image";
else
<img src="../images/<?php echo $image; ?>"> ;
?>

Obviously this does not work. Any suggestions on how to get it to work?

So if $image's value is 'none' then it echo's 'no image'
If its not then it echo's what ever the value is as an image name.
Hence displaying that image.

Hope my explanation was ok.

Only learning this stuff at the moment. Is this the right way to go about this?
Any advise welcomed.

Thanks
Gavin

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by hinfeyg2
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.