PHP: Hypertext Preprocessor (PHP) is a server-side scripting language frequently used as part of web development and as a command-line tool for common tasks.
A common metaphor for understanding variables in programming languages is a bucket. When values are assigned, something is put in the bucket. When a variable is used, whatever is in the bucket is examined.
In PHP variables start with a dollar sign. Immediately after the dollar sign is the name of the variable. Like many other programming languages, variable names can only contain letters, numbers, and the underscore. Special characters cannot be used.
PHP is a loosely typed programming language. This means that, unlike some other languages in which variables have data types, they do not in PHP. A variable, back to the metaphor of a bucket, is a generic one. Any type of value can be in variable at nearly any time.
Variables can also be freely created. There are very few set rules on where and how variables can be created on PHP. Simply using a dollar sign and a new name will create that variable for use. Whenever they are needed, variables can be created freely.
While PHP can be used as a server-side language, testing using a Command-Line Interface (CLI) is often recommend for development and learning purposes. To see the values in variables, the functions echo and print can be used to show output on the command-line.