On this page
- 1 PHP Tutorials
- 2 PHP Tutorials
- 2.0.0.1 CRUD App in PHP
- 2.0.0.2 Understanding PHP’s Array Manipulation: Exploring References and Unsetting
- 2.0.0.3 PHP built-in functions
- 2.0.0.4 Mastering Dependency Management with Composer: A Comprehensive Guid
- 2.0.0.5 Associative Array Example in PHP
- 2.0.0.6 Class and Object Example in PHP
- 2.0.0.7 PHP: Sum of two number
- 2.0.0.8 PHP How to get first and last name from full name?
- 2.0.0.9 How to create CSV file in PHP?
- 2.0.0.10 PHP: serialize() Function
- 2.0.0.11 Cheatsheet: PHP
- 2.0.0.12 PHP: global variable
- 2.0.0.13 Understanding PHP Error Reporting Configuration
- 2.0.0.14 PHP: Date and Time Function
- 2.0.0.15 PHP : Function
- 2.0.0.16 PHP: JSON Encode and Decode
- 2.0.0.17 PHP: Scrap Images Using cURL
- 2.0.0.18 What is curl in php?
- 2.0.0.19 PHP: Quiz App
- 2.0.0.20 PHP: Arrays
PHP Tutorials
PHP Tutorials
July 18, 2019
<?php echo "Hello World";?>
Output: Hello World
Explanation:
A PHP script starts with <?php and ends with ?>
In PHP there are two basic ways to get the output: echo
and print
.
<?php print "Hello World";?>
Output: Hello World
What is difference between echo
and print
?
The differences are small: echo
has no return value while print
has a return value of 1 so it can be used in expressions. echo
can take multiple parameters while print
can take one argument. echo
is marginally faster than print
.
“Hello world!” : is a string (sequence of characters).
Note: PHP statements end with a semicolon (;).