Home | | Computer Application 12th Std | Create and Execute ECHO and PRINT statements in PHP program

Practical Experiments | Computer Applications - Create and Execute ECHO and PRINT statements in PHP program | 12th Computer Applications : Practical Experiments

Chapter: 12th Computer Applications : Practical Experiments

Create and Execute ECHO and PRINT statements in PHP program

To create and execute ECHO and PRINT statements in PHP program.

Create and Execute ECHO and PRINT statements

 

AIM

To create and execute ECHO and PRINT statements in PHP program.

 

Procedure

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)


PROGRAM

<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>


OUTPUT

Welcome to Tamilnadu

Welcome to our School!

***********

 

Learn PHP

Study PHP Daily

9

 

HELLO

Hi Welcome

10

Tags : Practical Experiments | Computer Applications , 12th Computer Applications : Practical Experiments
Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
12th Computer Applications : Practical Experiments : Create and Execute ECHO and PRINT statements in PHP program | Practical Experiments | Computer Applications


Privacy Policy, Terms and Conditions, DMCA Policy and Compliant

Copyright © 2018-2024 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.