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.