Variables:
A variable is simply a container that’s used to store both numeric and non-numeric information.
PHP has some simple rules for naming variables. Every variable name must be preceded with a dollar ($) symbol and must begin with a letter or underscore character,optionally followed by more letters, numbers, or underscore characters.
Common punctuation characters, such as commas, quotation marks, or periods, are not permitted in variable names; neither are spaces. So, for example, $root, $_num, and $query2 are all valid variable names, while $58%, $1day, and email are all invalid variable names.
Assigning Values to Variables:
Assigning a value to a variable in PHP is quite easy: use the equality (=) symbol, which
also happens to be PHP’s assignment operator. This assigns the value on the right side of
the equation to the variable on the left.
For Example, $now = 2008;
Destroying Variables:
To destroy a variable, pass the variable to PHP’s function named unset() function.
Inspecting Variable Contents
PHP offers the var_dump() function, which accepts a variable and X-rays it for you.
Understanding PHP’s Data Types:
The values assigned to a PHP variable may be of different data types, ranging from simple
string and numeric types to more complex arrays and objects. You’ve already seen two of
these, strings and numbers, in action in previous examples. Here’s a full-fledged example,
which introduces three more data types:
Booleans are the simplest of all PHP data types. Like a switch that has only two states,
on and off, it consists of a single value that may be set to either 1 (true) or 0 (false).
In this listing, $validUser is a Boolean variable set to true.
● PHP also supports two numeric data types: integers and floating-point values. Floatingpoint
values (also known as floats or doubles) are decimal or fractional numbers, while
integers are round numbers. Both may be less than, greater than, or equal to zero. In
this listing, $size holds an integer value, while $temp holds a floating-point value.
● For non-numeric data, PHP offers the string data type, which can hold letters, numbers,
and special characters. String values must be enclosed in either single quotes or double
quotes. In the previous listing, $cat is a string variable containing the value ‘Siamese’.
● You may also encounter the NULL data type, which is a “special” data type first
introduced in PHP 4. NULLs are used to represent “empty” variables in PHP; a variable
of type NULL is a variable without any data. In the preceding listing, $here is NULL.
Setting and Checking Variable Data Types
Unlike other programming languages, where a variable’s data type must be explicitly defined by the programmer, PHP automatically determines a variable’s data type from the content it holds. And if the variable’s content changes over the duration of a script, the language will automatically set the variable to the appropriate new data type.
PHP introduces gettype() operator, which is a handy little tool for finding out the type of a particular variable.
Using Constants
Constants are defined using PHP’s define() function, which accepts two arguments: the name of the constant, and its value. Constant names must follow the same rules as variable names, with one exception: the $ prefix is not required for constant names.

It’s going to be finish of mine day, except before ending I
am reading this fantastic paragraph to improve my know-how.
LikeLike
Thanks for finally talking about >PHP Variables – PᎻP-TUTОRIAL <Loved it!
LikeLike