After writing a hello world program, I will make a program that will show that how to add two numbers in PHP, which is very important for beginners to learn PHP.
______________________________________________________________________________
<?php
$a=10; //Assign 10 to variable a
$b=15; // Assign 15 to variable b
$c=$a+$b; // Add a and b and assigns to c
echo $c; // Print c
?>
_________________________________________________________________________________
Otput: 25
You can check this program using online PHP interpreter.
Link-http://www.runphponline.com/
To know how was it executed, see the video.

______________________________________________________________________________
<?php
$a=10; //Assign 10 to variable a
$b=15; // Assign 15 to variable b
$c=$a+$b; // Add a and b and assigns to c
echo $c; // Print c
?>
_________________________________________________________________________________
Otput: 25
You can check this program using online PHP interpreter.
Link-http://www.runphponline.com/
To know how was it executed, see the video.
Comments
Post a Comment