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. Link to comment https://forums.phpfreaks.com/topic/225445-is-end-if-needed/ Share on other sites More sharing options...
Pikachu2000 Posted January 23, 2011 Share Posted January 23, 2011 Not when using curly braces; no. Link to comment https://forums.phpfreaks.com/topic/225445-is-end-if-needed/#findComment-1164165 Share on other sites More sharing options...
spacepoet Posted January 24, 2011 Author Share Posted January 24, 2011 OK, thanks for clarifying! Link to comment https://forums.phpfreaks.com/topic/225445-is-end-if-needed/#findComment-1164192 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.