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.

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.

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.

[rps-include post=6522]

Leave a Reply

Your email address will not be published. Required fields are marked *

Enjoy this blog? Please spread the word :)