samedi 20 février 2021

error while using if statement inside image in php

i have a codeigniter php website, in the image tag I have given an if statement to determine the source, the code is like below:

<img class="st_img" <?php if(str_replace(' ', '',$val['unique_tblkey'])=='entertainment'){?> src=" <?php echo ADMIN_IMG.strtolower(str_replace(' ', '',$val['unique_tblkey'])).'s/'.$val['image'][0]['btp_image'];?>"<?php} else { ?> src=" <?php echo ADMIN_IMG.strtolower(str_replace(' ', '',$val['unique_tblkey'])).'/'.$val['image'][0]['btp_image'];?> " <?php } ?>/>
                

I am getting

unexpected '}'

this error is coming although there isn't any unwanted brackets, can anyone please tell me what is wrong in my code, thanks in advance

Aucun commentaire:

Enregistrer un commentaire