Sunday, March 18, 2007

6th entry - PHP data types

According to 'http://www.smartwebby.com' Jandus Technology(2006), the data types of a variable is not set by the programmer but is determine by the PHP after it processes the input from the web. The data types in PHP are:

  • String data type:
    • Sample of String data type: '$strName = "Jimmy";'
  • Numeric data type
    • Sample of Integer numeric data type: '$intNo = 123;'
    • Sample of Double numeric data type: '$doubCash = 12.34;'
  • Array data type
    • Sample of Array data type: '$arrBox[0] = 543; $arrBox[1] = 345; $arrBox[2] =567;'

PHP stores quite an amount of whole numbers in platform-dependent range. The range of the data type or variable is usually the length of 32-bit (2 the power of 32). Integer Variable can ber set to negative or positive value. Double variable are usually also called floating point variable where they can be specific by using or assigning 'point' in the integer notation

Reference
Jandus Technology(2006), "Variable in PHP", http://www.smartwebby.com/PHP/variable.asp