php代码错误语法T_LNUMBER

时间:2013-07-22 22:30:52

标签: php

你好,有人可以帮助我这个PHP我真的不懂模板,所以我把我的PHP放在托管和当我启动它。有这样的文字

  

“第4行/home/u623442461/public_html/d.php中的”解析错误:语法错误,意外T_LNUMBER,期待')'

然后我在phpcodechecker上检查我的第4行,结果就像这个结果

结果

Error: There is 1 array declaration that contain a single equal sign '=' instead of '=>':

=array(0,40,60,100,200,350,550,800,1113,1504,1993,2604,3368,4323,5517, 7010,8876,11209,13659,16232,18934,21771,24750,27878,31162,34610,38230,42031,4602 2,50213,54614,59235,64087,69182,74532,80150,86049,92243,98747,105576,112746,1202 75,128180,136480,145195,154346,163955,174044,184637,195760,207439,219702,232578, 246098,260294,275200,290851,307285,324541,342660,361685,381661,402636,424660,447 785,472066,497561,524331,552440,581954,612944,645484,679651,715526,756782,804226 ,858787,921532,993689,1076670,1172098,1281840,1408043,1553176,1720079,1912017,21 32746,2386584,2678498,3014199,3400255,3844219,4354778,4941921,5617135,6393631,72 86601,8313517,9494470,2016089205);
  

PHP语法检查:解析错误:语法错误,意外T_LNUMBER,   在第1行的代码中期待')'

 $listlevel=array(0,40,60,100,200,350,550,800,1113,1504,1993,2604,3368,4323,5517, 7010,8876,11209,13659,16232,18934,21771,24750,27878,31162,34610,38230,42031,4602 2,50213,54614,59235,64087,69182,74532,80150,86049,92243,98747,105576,112746,1202 75,128180,136480,145195,154346,163955,174044,184637,195760,207439,219702,232578, 246098,260294,275200,290851,307285,324541,342660,361685,381661,402636,424660,447 785,472066,497561,524331,552440,581954,612944,645484,679651,715526,756782,804226 ,858787,921532,993689,1076670,1172098,1281840,1408043,1553176,1720079,1912017,21 32746,2386584,2678498,3014199,3400255,3844219,4354778,4941921,5617135,6393631,72 86601,8313517,9494470,2016089205);

4 个答案:

答案 0 :(得分:1)

许多数字都有空格。这导致错误。

这是删除空格的正确声明:

第一个阵列:

$numArray = array(0,40,60,100,200,350,550,800,1113,1504,1993,
    2604,3368,4323,5517,7010,8876,11209,13659,16232,18934,21771,
    24750,27878,31162,34610,38230,42031,46022,50213,54614,
    59235,64087,69182,74532,80150,86049,92243,98747,105576,
    112746,120275,128180,136480,145195,154346,163955,174044,
    184637,195760,207439,219702,232578, 246098,260294,275200,
    290851,307285,324541,342660,361685,381661,402636,424660,
    447785,472066,497561,524331,552440,581954,612944,645484,
    679651,715526,756782,804226,858787,921532,993689,1076670,
    1172098,1281840,1408043,1553176,1720079,1912017,2132746,
    2386584,2678498,3014199,3400255,3844219,4354778,4941921,
    5617135,6393631,7286601,8313517,9494470,2016089205);

第二阵列:

$listlevel = array(0,40,60,100,200,350,550,800,1113,1504,1993,2604,3368,
    4323,5517,7010,8876,11209,13659,16232,18934,21771,24750,27878,31162,
    34610,38230,42031,46022,50213,54614,59235,64087,69182,74532,80150,
    86049,92243,98747,105576,112746,120275,128180,136480,145195,154346,
    163955,174044,184637,195760,207439,219702,232578,246098,260294,275200,
    290851,307285,324541,342660,361685,381661,402636,424660,447785,472066,
    497561,524331,552440,581954,612944,645484,679651,715526,756782,804226,
    858787,921532,993689,1076670,1172098,1281840,1408043,1553176,1720079,
    1912017,2132746,2386584,2678498,3014199,3400255,3844219,4354778,4941921,
    5617135,6393631,7286601,8313517,9494470,2016089205);

旁注:您可以使用支持语法突出显示的IDE。此外,将数组拆分为多行将提高可读性,并帮助您快速找到错误。

希望这有帮助!

答案 1 :(得分:0)

您在其中一个号码中有空格:

$listlevel=array(... 1912017,21 32746,2386584...

答案 2 :(得分:0)

您的号码中有多个空格(可能是丢失的点?)

..., 7010,...
...,4602 2,..
...,72 86601,...
etc etc

也许您应该使用编辑器检查您的代码

答案 3 :(得分:0)

对于第二个数组..在创建数组时错过了comer,但整数之间有一个空格..这会触发错误。

原始切片:

38230,42031,4602 2,50213,
                ^ // Missing comma 

以及此处:

,105576,112746,1202 75,128180,
                    ^ // Here

   361685,381661,402636,424660,447 785,
                                  ^ Here

,1912017,21 32746,2386584,2678498
           ^ Here

6393631,72 86601,8313517,9494470,2016089205
           ^Finally here

固定数组:

$listlevel=array(0,40,60,100,200,350,550,800,1113,1504,1993,2604,3368,4323,5517, 7010,8876,11209,13659,16232,18934,21771,24750,27878,31162,34610,38230,42031,4602, 2,50213,54614,59235,64087,69182,74532,80150,86049,92243,98747,105576,112746,1202, 75,128180,136480,145195,154346,163955,174044,184637,195760,207439,219702,232578, 246098,260294,275200,290851,307285,324541,342660,361685,381661,402636,424660,447, 785,472066,497561,524331,552440,581954,612944,645484,679651,715526,756782,804226 ,858787,921532,993689,1076670,1172098,1281840,1408043,1553176,1720079,1912017,21, 32746,2386584,2678498,3014199,3400255,3844219,4354778,4941921,5617135,6393631,72, 86601,8313517,9494470,2016089205);