PHP Conditional Statements Explanation

Conditional Statements are frequently used subject in PHP programming language. No single PHP program can be possible without conditional statements. So, a newbie programmer should have better understanding on PHP conditional statements. Conditional statements are mainly used to take various logical decisions in PHP programming and PHP relational operators are frequently used in PHP conditional statements. In my previous article I explained PHP operators and expression and in this article I will discuss PHP Conditional Statements elaborately.  Conditional Statements in PHP Actually no program is possible without conditional statements. So, like other programming language conditional statements are also used in PHP programming language. PHP Conditional Statements can be divided into the following five categories. PHP if clause or if condition PHP if else condition PHP nested if else condition PHP else if ladder or multiple else if condition PHP switch case condition PHP if Clause PHP if condition is used to check a single condition. PHP if clause is trigger when its expression becomes true. PHP if conditional statement is expressed like the following structure.  if(expression){// The body of if clause goes here}ORif(expression) :// the body of if statement goes hereendif; The above structure says, if the expression becomes true, […]

Continue reading


PHP Operators and Expression Explanation

Operator and operand collectively makes expression. Basically no PHP program is possible without operator and expression. So, a newbie PHP programmer should have proper knowledge on PHP operators and expression. The more we be expert on PHP operators, the more we be smart on PHP programming. So, there is no alternative to have strong knowledge on PHP operators if we want to be a smart PHP programmer. In my previous article I explained PHP data types and variable. In this article I will discuss PHP Operators and Expression elaborately. PHP Operators Operators are used to make an expression which provides a meaningful result to process any algorithm in PHP programming. The following line is a simple example on PHP operator.  6+4=10 Here, 6, 4 and 10 are operands and plus sign (+) and equal sign are operators. All are making an expression together and providing a result which can be used further algorithm processing. Kinds of Operator in PHP Like other programming language, various kinds of operators are used in PHP language. The following eight kinds of operators are usually used in PHP programming language. Arithmetic Operator Increment and Decrement Operator Assignment Operator Comparison or Relational Operator Concatenation Operator Logical […]

Continue reading