PDA

View Full Version : If condition with or


gatsman
04-22-2014, 01:04 PM
I got an if like:
Code:


<vb:if condition="$channel['nodeid'] != 16">
<tr><td>Something</td></tr>
</vb:if>

but i need it to also check for 20 so it must be something like:
Code:


if $channel['nodeid'] != 16 || $channel['nodeid'] != 20

how do i write that

gatsman
04-22-2014, 01:56 PM
<vb:if condition="!in_array($channel['nodeid'], array(16,20))">

Zachery
04-22-2014, 02:29 PM
Your first condition will always be true, if thenodeid isn't 16. I believe this makes it so the second part is never checked.