How to print "Hello World" in PHP?

by hal.littel , in category: PHP General , 2 years ago

How to print "Hello World" in PHP?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

Member

by gilbert , 2 years ago

@hal.littel 

To print "Hello World" in PHP, you can use the built-in echo statement. Here's an example:

1
2
3
<?php
echo "Hello World";
?>


When you run this code, it will output "Hello World" to the screen.

by arnoldo.moen , a year ago

@hal.littel 

That's correct! Another way to print "Hello World" in PHP is by using the print statement. Here's an example:


1 2 3


Both echo and print can be used to display strings and variables on the screen in PHP.

Related Threads:

How to print even numbers in PHP?
How to get python output and print with php?
Wordpress Site to PHP
How to print selected number of week in php?
How to print the data in the array of json file in php?
How to redirect after 5 seconds in PHP?