Declaration: Variables in PHP are declared with a dollar sign ($) followed by the variable name. For example, $name = "John";.
Naming Conventions:
Variable names in PHP must start with a letter or an underscore,
followed by any combination of letters, numbers, and underscores. They
are case-sensitive ($Var and $var are different variables).
Types: PHP is a loosely typed language, so variables can change type as needed. For example, $age = 25; can later become $age = "twenty-five";.
Scope:
PHP variables can have different scopes—local (within a function or
block), global (throughout the script), or static (preserving values
across function calls).
Superglobals: PHP has predefined global arrays like $_GET, $_POST, $_SESSION, and $_COOKIE which are used to handle form data, sessions, and cookies.