Jump to content

Is Equal to Parse error


AFBlue78

Recommended Posts

Hello to all,

  I can use some advice as quickly as possible.  I am working on a final project and need some assistance in clearing an "Is Equal To" Parse error.  The error starts with the "If" statement before the ($n1 == n$2 ==$n3).  Below is the portion of the code that is causing the error.  If I comment this out the rest of the project works.  I am under a tight time deadline for this.  Thank you for reviewing and providing  ideas.

 

 

  if$n1 == $n2 == $n3 {

     

$credits += 100;

 

    print("Congratulations, you won 100 Credits!");

 

}elseif{($n1 == $n2 OR $n2 == $n3 OR $n1 == $n3) // Make sure to check for $n1 matching $n3!!

}

{

 

  $credits += 10;

 

  print("Winner! Here's 10 credits!"); }

 

else {

print("Sorry! Try Again!");

}

 

  //Subtract credits for playing

  $credits -= 1;

    else {  //The player doesn't have any credits to play

    print ("You don't have any credits left to play with!");

}{

  } else { // The user hasn't played yet, give the player 25 credits //

      $credits = 10;

  }

Link to comment
https://forums.phpfreaks.com/topic/156716-is-equal-to-parse-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.