Loading video...
Variables & Numeric Data Types
- PHP has eight pre-defined data types: four 'scalar' types (integer, float, string, boolean), two 'composite' types (array, object), and two 'special' types (resource, null).
- An identifier is a name created in PHP code to refer to a particular piece of data.
- The ‘assignment’ of data to an identifier is the process by which the reference, or association, between an identifier and its data value is made.
- A variable is an identifier for which the data value assigned to it can change, or ‘vary’.
- Variable identifiers begin with a $ followed by the variable’s name.
- Variable names are case-sensitive and must start with a letter or underscore followed by any number and combination of letters, underscores, and numbers.
- Static, or 'hard-coded', values assigned to variables are known as literals .
- The integer data type is for representing integral, or whole, numbers.
- Integer literals can be specified in decimal, hexadecimal, or octal notation.
- The float data type is for representing floating-point numbers, or numbers with fractional parts.
- Float literals can be specified as decimal numbers in regular or exponential notation.
- var_dump() is a built-in PHP function that ouptuts the type and value of a variable.
- Additional resources:
Variables & Numeric Data Types
Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.

































Start Learning Now
Our free lessons will get you started (Flash® 10 required).
Sign up for Educator.comGet immediate access to our entire library.
Features Overview