Author: Admin 11/30/2023
Language:
PHP
Tags: php hello world html
This is a basic PHP page for beginners.
Create a file named index.php and put it in your web server's root directory (DOCUMENT_ROOT) with the following content.
Example:
<!DOCTYPE html>
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
</body>
</html>
This is a basic HTML page with a PHP tag using echo to output Hello World.
Now that you have successfully created a working PHP script, it is time to create the most famous PHP script! Make a call to the phpinfo() function and you will see a lot of useful information about your system and setup such as available predefined variables, loaded PHP modules, and configuration settings. Take some time and review this important information.
Replace the <?php echo '<p>Hello World</p>'; ?>
Hello World tag with this.
<?php phpinfo(); ?>