Page 172 - CITS - Computer Software Application -TT
P. 172

COMPUTER SOFTWARE APPLICATION - CITS




           •  Boolean
           •  Array
           •  Object

           •  NULL
           •  Resource
           Getting the Data Type
           You can get the data type of any object by using the var_dump() function.
           Example





















           The var_dump() function returns the data type and the value:
           PHP String
           A string is a sequence of characters, like “Hello world!”.






















           A string can be any text inside quotes. You can use single or double quotes:
           PHP Integer
           An integer data type is a non-decimal number between -2,147,483,648 and 2,147,483,647.

           Rules for integers:
           •  An integer must have at least one digit
           •  An integer must not have a decimal point
           •  An integer can be either positive or negative

           •  Integers can be specified in: decimal (base 10), hexadecimal (base 16), octal (base 8), or binary (base 2)
              notation




                                                           159

                             CITS : IT&ITES - Computer  Software Application - Lesson 47 - 62
   167   168   169   170   171   172   173   174   175   176   177