PHP Hello World
Your First PHP Script
<?php
echo "Hello, World!";
?>
Save this as index.php in your web server's document root.
How to Run
- Install PHP or use XAMPP/WAMP/MAMP
- Save the file as
.php - Access it via
http://localhost/index.php
PHP Tags
PHP code is wrapped in <?php ... ?> tags. Files can mix PHP and HTML freely.