1

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

     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;

目前正在吐出这行错误:希望有任何帮助。

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

3 回答 3

7

你应该替换=>>=

于 2012-09-08T13:49:48.380 回答
1

您正在尝试检查是否大于或等于应该使用:

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

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

if( $get_display->gpa['88'] == "something" )
于 2012-09-08T13:50:40.963 回答
0

你把运营商混在一起了!你想使用 >=

于 2012-09-08T13:50:31.807 回答