0% found this document useful (0 votes)
11 views1 page

Installing PHP Tutorial

Uploaded by

rahulxxe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views1 page

Installing PHP Tutorial

Uploaded by

rahulxxe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Hello World Program in PHP

In PHP, creating a "Hello World" program is a simple and effective way to start coding. It allows you
to test that your environment is set up correctly and that PHP is functioning as expected.

<?php
echo "Hello, World!";
?>

Explanation:
 <?php and ?> are PHP opening and closing tags respectively. All PHP code must be
placed between these tags.
 echo is a PHP function used to output strings or variables. In this case, it outputs the
string "Hello, World!".
 The semicolon ; is used to terminate statements in PHP.
Running the Program:
To run this PHP program:
1. Create a new file with a .php extension, for example, hello_world.php.
2. Copy the above code into the file.
3. Save the file.
4. Open a terminal or command prompt.
5. Navigate to the directory where you saved the file.
6. Run the following command:

Code:
php hello_world.php
Output:
Hello, World!

You might also like