Variables
Scalar Variables
- We have seen basic assignment of scalar (single data element)
variables already:
$myVar = 'c'; # Character
$myVar = "Hello World!"; # String
$myVar = 42; # Integer
$myVar = 3.14159; # Float
- Notice that we did NOT have to
- declare the variable before using it
- define the variable's data type
- allocate memory for new data values