vendredi 30 janvier 2015

PHP if then else for all url starting with this domain else do smthn else

I have an easy php question , i want if all the domains starting with for e.g. www.blabla.com/.. do this else for all other domains of the web do smthng else,, my php code with the embeded html is like that,,, how can i avoid all the cases and have just one if and one else and not have elseif... i hope u understand my question ...



<?php if ($item->getPrimaryLink()) : ?></br>

<?php if ($item->getPrimaryLink()->getUrl() == "http://ift.tt/18C5AkT") : ?></br>

<a href="<?php echo $item->getPrimaryLink()->getUrl(); ?>" class="readon"><span><?php rc_e('READ_MORE'); ?></span></a>

<?php elseif ($item->getPrimaryLink()->getUrl() == "http://ift.tt/1yJhnCO") : ?></br>

<a href="<?php echo $item->getPrimaryLink()->getUrl(); ?>" class="readon"><span><?php rc_e('READ_MORE'); ?></span></a>

<?php elseif ($item->getPrimaryLink()->getUrl() == "http://ift.tt/18C5AkV") : ?></br>

<a href="<?php echo $item->getPrimaryLink()->getUrl(); ?>" class="readon"><span><?php rc_e('READ_MORE'); ?></span></a>

<?php elseif ($item->getPrimaryLink()->getUrl() == "http://ift.tt/1yJhkqL") : ?></br>

<a href="<?php echo $item->getPrimaryLink()->getUrl(); ?>" class="readon"><span><?php rc_e('READ_MORE'); ?></span></a>

<?php else : ?></br>

<a href="<?php echo $item->getPrimaryLink()->getUrl(); ?>" class="modal" rel="{size: {x: 1024, y: 550}, handler:'iframe'}"><span><?php rc_e('READ_MORE'); ?></span></a>

<?php endif; ?>


Thank you all and any ideas or suggestions would be really appreciated.. Thank you guys..


Aucun commentaire:

Enregistrer un commentaire