spacepoet Posted January 23, 2011 Share Posted January 23, 2011 Hello: I have a small chunck of code that dosplays data depending on which PlayerID is selected. Like so: <?php $myvar = $_REQUEST['PlayerID']; ?> ... <?php if ( $myvar == "1" ) { echo "Your name is Tina"; } elseif ( $myvar == "2" ) { echo "Your name is Sue"; } else { echo "Your name is Jill"; } ?> This works fine - no errors - but I am use to ASP and using an "End If" after "Else" ... Is this not needed in PHP? Thanks. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted January 23, 2011 Share Posted January 23, 2011 Not when using curly braces; no. Quote Link to comment Share on other sites More sharing options...
spacepoet Posted January 24, 2011 Author Share Posted January 24, 2011 OK, thanks for clarifying! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.