Last updated: August 27, 2026.
PHP is a server-side language used for web applications, APIs, command-line programs, and background jobs. The browser receives the response PHP generates, not the PHP source.
<?php
declare(strict_types=1);
$name = trim((string) ($_GET['name'] ?? 'visitor'));
if ($name === '') $name = 'visitor';
?>
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Greeting</title>
<h1>Hello, <?= htmlspecialchars($name, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') ?></h1>PHP can process forms, query databases, render HTML, return JSON, and work with files. Keep the runtime and dependencies supported and store secrets outside the public directory.
See the PHP getting-started guide.
One thought on “What Is PHP?”