PHP stands for Hypertext Preprocessor. It is a widely-used, open-source scripting language especially suited for web development and can be embedded directly into HTML.
PHP is a server-side language, meaning the code runs on the server and sends only the final output (HTML) to the browser.
PHP code is written inside <?php ... ?> tags. Each statement ends with a semicolon.
// Basic PHP syntax example
<?php
echo "Hello, World!";
?>
Change the code in the "Server" side to see how it renders on the "Client" side.
PHP can be embedded directly inside HTML files to generate dynamic content.
// PHP embedded inside HTML
<!DOCTYPE html>
<html>
<body>
<h1>Welcome</h1>
<p>
<?php
echo "Hello, World!";
?>
</p>
</body>
</html>
The browser receives plain HTML such as Hello, World! after the PHP code executes on the server.
Think of PHP as a hidden engine. Users never see the PHP code—only the result it produces.
index.php and print a greeting