In the above example Variable($mycar) hold value="honda city". Now we wants to
concatenate variable with string. pass this variable($mycar) inside echo statement. To
concatenate this with a string("is riding") use dot(.) between variable name and string.
The output will be displayed : Honda City is riding
Eg iii (Sum of two numbers)
<?php
$first = 100;
$second = 200;
$third = $first + $second;
echo "Sum = ".$third;
?>
Output- Sum = 300
In the above example Declare $first , $second variable with value=100, 200
respectively. Now add these two numbers using arithmetic operator ("+"). sum of
these two variable result stored in a third variable($sum). Now print the sum passing
($third) with echo statement with a string.
Eg iv (Subtraction of two numbers)
<?php
$first = 1000;
$second = 500;
$third = $first - $second;
echo "Subtraction = ".$third;
?>
Output- Subtraction = 500
In the above example We perform subtraction using variables( $first, $second) with
vale=1000,500. Subtract second variable from first, result is hold by third
variable($third) . Print this third variable passing with echo statement.
Destroying PHP Variables
To destroy a variable, pass the variable to PHP's unset( ) function. as in the following
example: