na" /> na" /> na"/>

How to write PHP if statement with an or

26 Views Asked by At

I am trying to write a conditional for a variable that is translated. The values are "Other" and "Autre".

This is my code here is

<?php if ( $item->name != "Other" ) : ?>
    <span><?php echo $item->name; ?></span>
<?php endif; ?>

This code works, and if I change "Other" to "Autre" it works on the translated page. If I use this code here the conditional does not work -

<?php if ( $item->name != "Other" || "Autre" ) : ?>
    <span><?php echo $item->name; ?></span>
<?php endif; ?>

How can I write this with an or?

0

There are 0 best solutions below