CS Knowledge Opener - Logo
CS Knowledge
Opener
Facebook Youtube Telegram
  • Home
  • 12th CS
    • 12th CS English Medium
    • 12th CS Tamil Medium
  • 12th CA
    • 12th CA English Medium
    • 12th CA Tamil Medium
  • 11th CS
    • 11th CS English Medium
    • 11th CS Tamil Medium
  • 11th CA
    • 11th CA English Medium
    • 11th CA Tamil Medium
  • CS / CA Question Bank
  • Other Subjects
  • Student Alerts
  • Govt Exams
  • Home
  • 12th CS
    • 12th CS English Medium
    • 12th CS Tamil Medium
  • 12th CA
    • 12th CA English Medium
    • 12th CA Tamil Medium
  • 11th CS
    • 11th CS English Medium
    • 11th CS Tamil Medium
  • 11th CA
    • 11th CA English Medium
    • 11th CA Tamil Medium
  • CS / CA Question Bank
  • Other Subjects
  • Student Alerts
  • Govt Exams
CS Knowledge Opener - Logo
CS Knowledge
Opener
Facebook Youtube Telegram
  • Home
  • 12th CS
    • 12th CS English Medium
    • 12th CS Tamil Medium
  • 12th CA
    • 12th CA English Medium
    • 12th CA Tamil Medium
  • 11th CS
    • 11th CS English Medium
    • 11th CS Tamil Medium
  • 11th CA
    • 11th CA English Medium
    • 11th CA Tamil Medium
  • CS / CA Question Bank
  • Other Subjects
  • Student Alerts
  • Govt Exams
  • Home
  • 12th CS
    • 12th CS English Medium
    • 12th CS Tamil Medium
  • 12th CA
    • 12th CA English Medium
    • 12th CA Tamil Medium
  • 11th CS
    • 11th CS English Medium
    • 11th CS Tamil Medium
  • 11th CA
    • 11th CA English Medium
    • 11th CA Tamil Medium
  • CS / CA Question Bank
  • Other Subjects
  • Student Alerts
  • Govt Exams
12th CA English Medium

Practical program exercise 8 PHP Create & Execute Echo and Print Statements for 12th computer applications

Baskaran J
February 16, 2023 2 Mins Read
1K Views
0 Comments

PHP Create & Execute Echo and Print Statements

echo

  • The echo statement produce output fast
  • It doesn’t return any value
  • The echo statement produces one or more lines of output.
  • The echo statement is missing the closing quotation mark.
  • The instructions in this instance consisted of a call to PHP’s echo statement, which is responsible for displaying output to the user; the output to be displayed is enclosed in quotation marks.

print

  • The print statement produce output slow
  • It return the value 1

variable

  • A variable is simply a container that’s used to store both numeric and non-numeric information.
  • And just as with any container, you can move it from place to place, add stuff to it, or empty it out on the floor in a pile and fill it with something completely different.

Assigning Values to Variables

  • Assigning a value to a variable in PHP is quite easy: use the equality (=) symbol, which also happens to be PHP’s assignment operator.
  • This assigns the value on the right side of the equation to the variable on the left.
  • PHP has some simple rules for naming variables.
  • Every variable name must be preceded with a dollar ($) symbol and must begin with a letter or underscore character, optionally followed by more letters, numbers, or underscore characters.
  • Common punctuation characters, such as commas, quotation marks, or periods, are not permitted in variable names; neither are spaces.

CA – 8 PHP – CREATE & EXECUTE ECHO AND PRINT STATEMENTS

QUESTION:

  • Write a PHP code to demonstrate the usage of echo and print in PHP.

AIM:

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

PROCEDURE:

1. Start Xampp server (Apache)
2. Go to virtual path folder (C:\xampp\htdocs)
3. Create test.php file and type the program
4. Execute the program on your Web browser using by this URL link (http://localhost/test.php)

PROGRAM:

<html>
<body>
<?php
echo “Welcome to Tamilnadu <br>”;
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

RESULT:

The Output was verified successfully

Tags:

Practical

Share Article

Follow Me Written By

Baskaran J

Other Articles

Previous

Practical program exercise 7 PHP Create & Execute Variables for 12th computer applications

Next

Practical program exercise 9 PHP String Functions for 12th computer applications

Next
February 17, 2023

Practical program exercise 9 PHP String Functions for 12th computer applications

Previous
February 15, 2023

Practical program exercise 7 PHP Create & Execute Variables for 12th computer applications

No Comment! Be the first one.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

18 − two =

Related Posts

12th CA Board Exam Answer Key Discussion 2024-2025

Baskaran J
March 14, 2025

12th Computer Applications English medium Program Question 2024-2025

Baskaran J
February 23, 2025

12th Computer Applications Practice One marks question 2024-2025

Baskaran J
February 3, 2025

12th Computer Applications English medium Public Exam Important Question 2024-2025

Baskaran J
January 16, 2025

Subscribe to our newsletter and stay updated.

CS Knowledge Opener

CS Knowledge Opener focuses on 11th &12th Computer Science & Computer Applications English Medium & Tamil Medium. Programming Skills and also we are Publishing Study Materials Based on New syllabus introduced by TNSCERT. (TNBOARD).

Quick Links

  • Contact Us
  • About Us
  • Privacy Policy
  • Disclaimer
  • Terms and Conditions
Categories
11th CA English Medium 15
11th CA Tamil Medium 9
11th CS English Medium 21
11th CS Tamil Medium 12
12th CA English Medium 32
12th CA Tamil Medium 8
12th CS English Medium 36
12th CS Tamil Medium 12
Government Exams 36
Notifications 8
Other Subjects 13

Follow Us

Youtube
Facebook
Telegram
CS Knowledge Opener © 2020 - 2025. All Rights Reserved.