Jump to content

How do I do an If else to fetch an image of a variable or a specific path


ABulcao

Recommended Posts

  <div class="section-img"><?php if ($imagePath <> '') { ?><img src="<?php echo 'https://' . $imagePath ?>"><?php } ?> 

                                                <?php if ($imagePath === '') { ?><img src="<?php echo '/img/avis/serviceClient.png' ?>"><?php } ?></div>  

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...