How To Declare Variable In PHP?

In Variable in nothing it is just a name of the memory location. A variable is simply a container i.e used to store both numeric and non-numeric information.

Rules For Declaring variables

Pass multiple strings

/* creating Variable in php */

<?php

$mycar 
"Honda City";

echo 
$mycar."Is Running";


?>

In the above exampe $mycar is a variable which hold the value of Honda City car.

Deleting the PHP variable :- To destroy a variable after using, pass the variable to PHP's unset() function.

/* destroying Variable in php */

<?php

$mycar 
"Honda City";

echo 
$mycar."Is Running";

unset(
$mycar);

echo 
$mycar."Is Running";


?>

PHP $ and $$ Variable
$$var uses the value of the variable whose name is the value of $var. It means $$var is known as refrence variable where as $var is normal variable.
It allows you to have a "variable's variable" - hte program can create the variable name the same way it can create any string.

/* creating refrence Variable in php */

<?php

$name 
"Rajiv";

$
$name "Sanjeev";

echo 
$name."<br/>";
echo $
$name."<br/>";
echo 
$Rajiv."<br/>";

?>

Output : -  Rajiv
            Sanjeev
            Sanjeev    

PHP Super Global Variables
PHP super global variable is used to connect PHP with HTML Form. PHP Super global variable is accessible inside the same page that defines it, as well as outside the page. While local variable's scope is within the page that defines is.
PHP Super Global Variables Are Given Bellow

PHP Constant
How to defined using define() function
LIKE : - define('ConstName','value');

Thank You