Web Analytics Made Easy -
StatCounter Stupid Parsing "Error" - CodingForum

Announcement

Collapse
No announcement yet.

Stupid Parsing "Error"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Stupid Parsing "Error"

    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:

    Code:
    </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.
    -Obiwan Jabroni
    May the Schwartz be With You

  • #2
    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.
    Create accessible online surveys -::- Koobten.com - compare netbook prices and reviews -::- Affordable, reliable hosting for less than $20 per year
    Zend Certified Engineer

    Comment


    • #3
      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...?
      -Obiwan Jabroni
      May the Schwartz be With You

      Comment


      • #4
        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
        ضkii - formerly pootergeist
        teckis - take your time and it'll save you time.

        Comment


        • #5
          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.
          -Obiwan Jabroni
          May the Schwartz be With You

          Comment


          • #6
            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.

            Comment

            Working...
            X