PHP Data Types


PHP Data Types

PHP recognize three kinds of data types, namely:
  1. Integer
  2. Floating point number
  3. String

Integer
Included in this data type is an integer (not use commas.) For example:
$a = 1234 / / decimal
$b = -1234 / / negative
$c = 0123 / / octal
$d = 0x12 / / hexadecimal

Statements such as $a = 1234 called assignment statements. In this example the intention is to give value 1234 to the variable $a.

Floating point number
Also called fractions. There are signs that a dividing point between the rounded and fractions.
$a = 1.234 / / normal form
$b = 1.2e3 / / exponential form

Strings
$a = "this is string data type"

0 comments:

Post a Comment