Php – Boolean Variable Types , True, False
Programming generally consist of numeric and logic operations. We have seen numeric variables in previous post. Now we will look other part. While developing applications we generally provide algorithm. Algorithms mostly provides execution diagram. We will use logic values to check and change the execution of the application.
Boolean logic uses
false as values and makes some calculations with operators. We will see these calculations and operators next chapters.
true is used to describe the positive and true situation. Positive numbers generally interpreted as
true in most situations by the functions or third party libraries. In the example below we will create a boolean variable which is named
$door_isopen and holds the door openness situation.
false is used to describe the negative and false situation. NEgative numbers generally interpreter as
false in most situations by the functions or third party libraries. In this example below we will create a boolean variable which is named
$door_isopen and holds the openness situation.
While developing applications we generally use different type those can hold values. But in some situation we may need to empty the variable. We can cal this nullify in other words. Nullify will remote current value and type. We can set null a variable with
NULL like below. Null evaluates false in boolean logic.