Type the following into your IDE or text editor.
Save the file as hello.php
Open a browser to your localhost/hello.php
You should see the word hello.
Congratulations. You've written your first PHP file.
The first line is an opening PHP tag.
Lines 2-5 are a multi-line comment.
The last line prints the contents of the single quotes to the browser.
PHP:
<?php
/**
* Created by PhpStorm.
* User: Your Name
*/
echo 'hello';
Save the file as hello.php
Open a browser to your localhost/hello.php
You should see the word hello.
Congratulations. You've written your first PHP file.
The first line is an opening PHP tag.
Lines 2-5 are a multi-line comment.
The last line prints the contents of the single quotes to the browser.