Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.