How to print "Hello World" in PHP?

by hal.littel , in category: PHP General , a year ago

How to print "Hello World" in PHP?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

Member

by gilbert , a year 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 , 6 months 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.