0

hello can someone help me with this php i don't really understand with template, so i've put my php in hosting and when i start it. there are text like this

"Parse error: syntax error, unexpected T_LNUMBER, expecting ')' in /home/u623442461/public_html/d.php on line 4 "

then i check my line 4 on phpcodechecker and the result is like this Results

Results

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 Syntax Check: Parse error: syntax error, unexpected T_LNUMBER, expecting ')' in your code on line 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 Answers 4

1

You have spaces in many of the numbers. That's causing the error.

Here's the correct declaration with the spaces removed:

First array:

$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);

Second array:

$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);

Sidenote: You can use an IDE that supports syntax highlighting. Also, splitting your array into several lines will improve the readability and will help you find errors quickly.

Hope this helps!

Sign up to request clarification or add additional context in comments.

Comments

0

You have a space in one of the numbers:

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

Comments

0

You have more than one space in your numbers (maybe a missing dot?)

i.e.

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

Maybe you should check your code with your editor

Comments

0

For the second array.. You have missed a comer when creating the array, but there is a space between the integers.. Which triggers the error.

Original slice:

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

and here aswell:

,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

Fixed array:

$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);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.