...

Stupid Parsing "Error"

ObiwanJebroni
07-08-2002, 02:52 PM
Ok, what's making me mad, is that I'm getting a PHP error that's tell me that I have a parsing error. The error reads:

Parsing error, unexpected $ on line 118.

Ok, here's line 118:


</html>


Oh man, that irritates me muchos. What does this mean? I reinstalled the interpreter, I resintalled Abyss, I took out that line, but it just seems to like that line where the </html> originally was. It's making me mad.

Also, how do you make an array? Is it like:

$myarray = array("yo", "yoyo", "yoyoyo");?

Thanks in advance.

bcarl314
07-08-2002, 03:52 PM
check the line before 118. Did you end it with a ";" semicolon???

I can't tell you how many times that throws me in a fit!

Good luck.

ObiwanJebroni
07-08-2002, 04:41 PM
Thanks for the suggestion. I found the error after staring at the code a while just now. It wasn't a semicolon. Actually, it was the fact that about 10 lines back, I had a mismatched "}". I was missing one and that was what was causing the error. Now, as to how to do arrays...?

Ökii
07-08-2002, 07:43 PM
That array would work fine :)

$arrayname = array('value1','value2','value3');
or
$arrayname = array();
$arrayname[0] = 'value1';
$arrayname[1] = 'value2';

or using reference names rather than numbers

$arrayname = array('name1' => 'value1','name2' => 'value2');
or
$arrayname['name1'] = 'value1';
$arrayname['name2'] = 'value2';

or multidimensionals-

$arrayname = array(array('valueA','valueB'),array('value1','value2'));
or
$arrayname[0][0] = 'valueA';
$arrayname[0][1] = 'valueB';
$arrayname[1][0] = 'value1';
$arrayname[1][1] = 'value2';

Basically :D

ObiwanJebroni
07-08-2002, 09:55 PM
Ah hah, I see. It's kind of strange having to declare arrays like that (since I came in assuming that PHP would be VERY similar to C++, especially in aspects of variables) but oh well, at least I get it now. Thanks.

Fitzbean
07-10-2002, 10:20 PM
You reinstalled things because of a parsing error? LOL... I can't tell you how valuable experiece in debugging can be when it comes to web programming - esp. when the very limited debugging information available isn't even helpful half the time.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum