Practice exercise -- Data types Categories of scalar (simple) data: Boolean: this is a logical type. Possible values are true, false. Integer: A data type for integers, or numbers without a decimal point. Examples are 0, 127, -2147483648, +32767 (+ sign not required) Floating-point (double, float): A data type for decimal numbers. Examples are: 0.0, 2.54, -3.21, 1.23E0 -4.56E0, 7.89E-1 String: A string is series of characters. One way to specify a string is to enclose it in single quotes (the character '). Example: $aString = 'this is a single-quoted string'; If the string is enclosed in double quotes ("), more escape sequences for special characters may be enclosed (i.e. \n \t ...). And, another important feature is that variable names will be expanded or interpolated. Example: $aString = 'this is a single-quoted string'; print "$aString inside a double-quoted string with line feed \n"; Indicate which simple data type could be used to represent the value: Value Integer Floating Boolean String Invalid ------------ ------- ----------- ------- ------ ------- 1. -32768 2. 2.52 3. false 4. "\t" 5. 0 6. 'Hello, World\n' 7. 1.2E3 8. True 9. "Hello, $name" Note: PHP is weakly typed. The type of the variable is determined by the value assigned to it. An example of defining a floating point variable: $amount = 0.00; then implicitly changing its type to integer: $amount = 0;