Array - A variable that can hold multiple, separate pieces of values. It's like a list of values, each value being a string or a number or even another array.

Object - The instance of a PHP class. The basics for class definitions and object-oriented programming.

Resource - Stores a reference to functions, databases, files, or other resources outside of PHP

NULL - Defines a variable with no value; the variable exists, but contains nothing (not an empty string, not the value 0, nothing)

- Usually the variable type is not explicitly specified, PHP automatically converts the variable to the correct data type.

Using variables

Variables are used for storing values, data like text strings, numbers or arrays.
When a variable is declared, it can be used over and over again in your script.
Regardless of what type you are creating, all variables in PHP follow certain syntactical rules:

Variable names have to begin with a dollar sign ($). For example, $name

After the dollar sign ($), the next character in the name must be a letter or an underscore; after this, the remainder of the variable name can be any combination of
letters, numbers, and underscores. For example, $var_name1

The name of a variable is case-sensitive, so $varname is a different variable than $varName

The variable named $this is reserved for use in Object Oriented PHP, so it can't be used elsewhere

Variables can be assigned values using the equals sign (=).

<?php
$var_name = value;
?>

There are two ways to assign values to variables: by value and by reference.

Assign by value

The typical way to do assignments is to define by value. Value can be a number, a string (or any data type), or another variable previously defined.

Assign value by reference

The reference approach allows the content of a variable to affect the value of another variable (previously defined), or a function to affect a variable that is not part of that function (see the lesson: Passing variable to function by reference).
To define a variable by reference, simply add the ampersand (&) character before the dollar sign ($).

- Once a variable is assigned by reference, it is tied to its referenced variable. If one of them changes, will transfer the same change to the other one. If you change the value of $var1 will change the value of $var2 too.Because assigning values by reference can complicate the script, it's better to avoid this.

Dynamic variables

A dynamic variable is named using two dollar signs ($$) and is associated with a normal variable that has a similar name.
The value of an usual variable gives the name (without the dollar symbol) to a second variable.

A dynamic variable does not contain its own value. Instead, it contains the location where you can find the value, in other words, the name of another variable.
The expresions: $var_name = "good_people"; and $$var_name; make result a variable "$good_people", the value of "$$var_name" is the value of "$good_people".

- Dynamic variables, as those by reference can be confusing and it's better to avoid them.