Skip to main content

Posts

Showing posts with the label php data types

PHP Data Types

 A data type identifies the characteristics that the assigned data will be interpreted by when interacting with the PHP programming language.  When a value is assigned a specific data type,  the PHP interpreter will work with the data based on the expected type of data it is.  For example, 27654 could be considered a numeric data type or it could be considered a string data type, such as in the zip code for a customer.  Even though you could perform mathematical equations on the zip code, it would make no sense to do so.  Thus,zip codes, even though they look like they would be numeric numbers should be identified as a string data type to eliminate problems such as zip codes that start with zero (ex. 08102).  Assigning the correct data type to the expected value is an important part of working with PHP.  There are three categories of data types in PHP: Scalar, Compound and Special.  PHP supports eight primitive types. Four scalar types: boolean integer float  (floati