Posts

Showing posts with the label PHP Data Type

What is PHP Data Type and Variable’s Data Type | PHP Gurukul

Image
  What is PHP Data Type ? All data stored in PHP variables fall into one of eight basic categories, known as data types. A variable’s data type determines what operations can be carried out on the variable’s data, as well as the amount of memory needed to hold the data. Types of Data Types in PHP Booleans Integers Doubles/Float Strings NULL Arrays Objects Resources Booleans This data type can only hold two types of values, which include TRUE and FALSE. There are situations that demand expressions to be evaluated as boolean giving the result of TRUE and FALSE. While performing such evaluations, the following rules must be kept in mind- If the expression evaluates to a number, which is zero, then the value of the expression is FALSE. Any other number is considered non-zero and is evaluated as TRUE. If the expression evaluates to a string, then the Boolean value of the expression is TRUE if it evaluates to a valid string. On the other hand, if the string is empty, then the expression ...