Create and Execute ECHO
and PRINT statements
To create
and execute ECHO and PRINT statements in PHP program.
1. Start Xampp server (Apache)
2. Goto virtual path folder (C:\xampp\htdocs)
3. Create echo-print.php file and type the program
4. Execute the program on your Web browser using by this URL link (http://localhost/ echo-print.php)
<html>
<body>
<?php
//Use Echo
echo “Welcome to
Tamilnadu<br>”;
// Use ‘print’ to print on console
print “Welcome to our
School!<br>***********”;
$txt1 = “Learn PHP”;
$txt2 = “Daily”;
$x = 5;
$y = 4;
echo “<h2>” . $txt1 .
«</h2>»;
echo “Study PHP “ . $txt2 .
«<br>”;
echo $x + $y;
$txt3 = “Hello”;
$txt4 = “Welcome”;
$x = 7;
$y = 3;
print “<h2>” . $txt3 .
«</h2>»;
print “Hi “ . $txt4 . «<br>”;
print $x + $y;
?>
</body>
</html>
Welcome to Tamilnadu
Welcome to our
School!
***********
Learn PHP
Study PHP Daily
9
HELLO
Hi Welcome
10
Related Topics
Privacy Policy, Terms and Conditions, DMCA Policy and Compliant
Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.