PHP Display Variables

By Kunal Kapoor
20-04-2018
450

In PHP the two most common output variables are echo and print. They are used to display. Values can be from a SQL database or any custom generated value as per application requirement. 


eg

<?php
$txt1 = "Open Learning";
$txt2 = "ourcoaching.com";

$o = 5;
$c = 4;

print "<b>" . $txt1 . "</b><br>";

print "Learn PHP from " . $txt2 . "<br>";

echo "Sum of ".$o ." and ". $c ." is ".($o+$c); ?>


Output is as follows:

Open Learning
Learn PHP from ourcoaching.com
Sum of 5 and 4 is 9




Related Tutorials