Php – Boolean Variable Types , True, False – POFTUT

Php – Boolean Variable Types , True, False


[rps-include post=6522]

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

Boolean logic uses true and false as values and makes some calculations with operators. We will see these calculations and operators next chapters.

True

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.

$door_isopen=true;

False

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.

$door_isopen=false;

Null

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.

$name=NULL;

[rps-include post=6522]

LEARN MORE  In Python Operator Usage Tutorial with Examples

Leave a Comment