Interview Questions

CONTROL STATEMENTS

Control statements allow you to execute blocks of code depending on conditions. They also allow you to repeat a block of code, which leads to simpler, more efficient scripts. Here we will introduce you to the decision-making statements if and switch. You will also learn about loops using for and while.

True and False

PHP has the concepts of true and false. Zero and an empty string are considered to be false. Any other numerical value or string is true. These concepts were discussed in regard to relational operators, but they are also used in control statements. Control statements like if expect a Boolean value, so any value they are given will be converted to a boolean.


Pragna Meter
Next Chapter  
e-University Search
Related Jobs