Enter your Sign-on user name and password.

Forgot password?
  • Follow us on:
Loading video...

Start Learning Now

Our free lessons will get you started (Flash® 10 required).
Get immediate access to our entire library.

Sign up for Educator.com

Features Overview

  • Get on-demand access to our complete library
  • Search and jump to exactly what you need to learn
  • Track your progress
  • Download practice and lesson files
  • *Ask questions and get answers from our community & instructors

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.

Computer Science: Introduction to PHP