有条件的结果

时间:2013-12-05 15:17:04

标签: php

我做错了什么?我试图在条件满足时获得绿色文本,或者在没有条件时获得普通文本。

这是我的代码:

if($result)
{
    echo ("<br> <u><b><h2>Totaal:</h2></b></u> <br>") ;

        if($formatted_one <= $formatted_two || $formatted_one <= $formatted_three || $formatted_one <= $formatted_four )
        {
        echo ("<b><font color='green'> Opties Brons</font></b><br> ") ;
        echo "Pakket Brons: &#8364 " . ($formatted_one) . "<br>" ;
        echo "Pakket Brons: &#8364 " . ($formatted_one_one) . " (inclusief all-in pakket) <br>" ;
        echo "<b>Het verschil is: &#8364 " . ($formatted_one_two) . " </b><br>" ;
        echo ("<br>") ;
        }
        else
        {
        echo ("<b>Opties Brons</b><br> ") ;
        echo "Pakket Brons: &#8364 " . ($formatted_one) . "<br>" ;
        echo "Pakket Brons: &#8364 " . ($formatted_one_one) . " (inclusief all-in pakket) <br>" ;
        echo "<b>Het verschil is: &#8364 " . ($formatted_one_two) . " </b><br>" ;
        echo ("<br>") ;
} 
else
{
    echo("<br>U heeft niet alles goed ingevuld");
}

感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

} else {
    echo ("<b>Opties Brons</b><br> ") ;

永远不要关闭......

所以你真的有

if() {
   ...
} else {
   ...
} else {
   ...
}

这个错误,添加缺少的}

相关问题