HannahI 0 Report post Posted November 19, 2009 (edited) Hi Again, If you just started here, please go back and read my other tutorial at http://forums.xisto.com/topic/97338-topic/?findpost=1064404535. Today we are going to be learning about the if statement, the else statement, the else if statement, other things. Let's Begin. Chapter 2 - If, else, and else if The If statement compares 2 variable, a number and a variable, or a number and a number. The else statement is similar to the if statment. The difference between the if statement and the else if statement is that the if statement is in the beginning and the else statement is at the end. I'm guessing that you alraedy guessed that the else if statement goes in the middle, if you did, your correct! You can have as many else if statement as you want. On the other hand, if you don't have an else statement, the else if statement could be at the end! Example: <?php $b = 1; if($b < 0) { echo "Hi"; } else { echo "Hello"; } ?> Chapter 2 - 2 - Comments A comment is a "note to self" which are invisable to the computer. A comment is after //. Similar to comment, they're block comment which are multi-line comments. Block comment are /* and */. Example <?php echo 'Hello' // I'm a comment /* I'm a block comment blah blah Bye */ ?> Thanks for reading Chapter 2 Edited November 20, 2009 by HannahI (see edit history) Share this post Link to post Share on other sites
yordan 10 Report post Posted November 20, 2009 Chapter 2 - Comments A comment is a "note to self" which are invisable to the computer. A comment is after //. Similar to comment, they're block comment which are multi-line comments. Block comment are /* and */. From a formal point of view, I would like to add two comments.First of all, usually, a chapter is a set of several pages in a book. A two-lines text should not be named "chapter". Secondly, be kind with your public. If you just started here, please go back and read myy other tutorial.It would be nice to add a link to go to the "other" tutorial you are talking about. Because, hopefully, you will write down several "other" tutorials, so a newbie cannot guess which one you are talking about. Share this post Link to post Share on other sites
HannahI 0 Report post Posted November 20, 2009 (edited) I'll change that now. Edited November 20, 2009 by HannahI (see edit history) Share this post Link to post Share on other sites