0

嗨,我是初学者,我试图在 smarty php 中编写一些嵌套的 if-else 语句。它无法识别它们并给出错误。我已经发布了我的代码片段,但最好有人给我一个例子。谢谢 :D

    {if $my_value[1]==1}
       {if}{/if}   ======>here I get the error
    {elseif $my_value[1]==2}
    {else}
     {/if}
4

1 回答 1

0

尝试这个:

{if $my_value[1] == 1}
    1
{elseif $my_value[1] == 2}
    2
{else}
    0
{/if}
于 2018-07-25T11:03:04.160 回答