如果在开关错误内

时间:2012-09-08 13:48:20

标签: php

你好我正在使用这行代码:

     case "3rd Year":
                 $lbl="4th Year";
**This is the line**       if( $get_display->gpa => "88" ) {
                                $section_name = 'A';
                            }
                            elseif( $get_display->gpa => "80" ) {
                                $section_name = 'B';
                            }
                            elseif( $get_display->gpa => "75" ) {
                                $section_name = 'C';                      
                            }
                 break;

目前Spatting这一行错误: 非常感谢任何帮助。

     Parse error: syntax error, unexpected T_DOUBLE_ARROW in C:\xampp\htdocs\Thesis\enrollpage.php on line 293

3 个答案:

答案 0 :(得分:7)

您应该将=>替换为>=

答案 1 :(得分:1)

你要么试图检查大于或等于哪个应该使用:

if( $get_display->gpa >= "88" )

或者你错过了if语句中的实际比较,如果它是一个数组:

if( $get_display->gpa['88'] == "something" )

答案 2 :(得分:0)

你混合了运营商!您想使用> =

相关问题