-6

我正在尝试根据几个临床因素生成特定的治疗算法。在从表单的下拉列表菜单中选择因素时,将提出处理算法。使用 elseif php 命令时,出现语法错误。请帮忙。谢谢。

<?php
        if(($t == '2' && ($n =='1') && ($er=='positive') && ($her == 'negative') && ($ki == 'Low (<14%)') && ($g=='G1') && ($ps == 'premenopause')) || (($t == '3' && ($n =='0') && ($er=='positive') && ($her == 'negative') && ($ki == 'Low (<14%)') && ($g=='G1') && ($ps == 'premenopause')) {  
        echo '<br />';
        echo '<br />';
        echo "T$t";
        echo "N$n";
        echo "M0.   ";
        echo "IIВ stage";
        echo '<br />';
        echo "Patient status: $ps";
        echo '<br />';
        echo "ER/PR status: $er" ;
        echo '<br />';
        echo "Her2/neu status: $her" ;  
        echo '<br />';
        echo "Ki-67 expression: $ki";
        echo '<br />';
        echo "Grade of differentiation: $g";
        echo '<br />';
        echo "Molecular subtype: Luminal А";
        echo '<br />';
        echo '<br />';
        echo '<img src="/img/Tx.png" border=0>';
        echo '<br />';
        echo '<br />';
        echo "$LumA3_1"; }
        else
        {
        echo "That combination does not exist";
        }
        ?>
4

3 回答 3

3

在你的最后如果你错过了一个“)”。

) || ($t == '3' &&
//   ^ you start it here

所以你需要改变:

 ($ps == 'premenopause')) {

 ($ps == 'premenopause'))) {
//                       ^
于 2013-05-10T12:18:14.787 回答
0

如果括号接近绝经前“)”,则关闭。在第一个回声之前。

于 2013-05-10T12:24:35.810 回答
0

将您的代码更改为您在 if 语句的第一行错过了右括号

if($t == '2' && ($n =='1') && ($er=='positive') && ($her == 'negative') && ($ki == 'Low (<14%)') && ($g=='G1') && ($ps == 'premenopause') || ($t == '3' && ($n =='0') && ($er=='positive') && ($her == 'negative') && ($ki == 'Low (<14%)') && ($g=='G1') && ($ps == 'premenopause'))) { 
                echo '<br />';
                echo '<br />';
                echo "T$t";
                echo "N$n";
                echo "M0.   ";
                echo "IIВ stage";
                echo '<br />';
                echo "Patient status: $ps";
                echo '<br />';
                echo "ER/PR status: $er" ;
                echo '<br />';
                echo "Her2/neu status: $her" ;  
                echo '<br />';
                echo "Ki-67 expression: $ki";
                echo '<br />';
                echo "Grade of differentiation: $g";
                echo '<br />';
                echo "Molecular subtype: Luminal А";
                echo '<br />';
                echo '<br />';
                echo '<img src="/img/Tx.png" border=0>';
                echo '<br />';
                echo '<br />';
                echo "$LumA3_1"; 
            }
            else
            {
                echo "That combination does not exist";
            }
于 2013-05-10T12:16:12.987 回答