HTML5 Elements & Entities

Named entities: © ® ™ € £ ¥ « » … – —  

Numeric entities (decimal): © ® €
Numeric entities (hex): © ® €

Article Title

Article body with bold, italic, highlighted, deleted, inserted, inline code, HTML, The Great Book, and Ctrl+S keyboard shortcuts.

Placeholder image
Figure caption with external link.
Click to expand

Hidden content revealed on expand.

User Information
Sample Data Table
IDNameValue
1Alpha100
2Beta & Gamma200
Total300
SVG

Embedded PHP

Hello from " . htmlspecialchars($name) . "!

\n"; echo "

Version: {$version}, PI: {$pi}

\n"; printf("

Formatted: %.2f

\n", $pi); // Heredoc / Nowdoc $heredoc = <<" . htmlspecialchars($heredoc) . "\n"; echo "
" . htmlspecialchars($nowdoc)  . "
\n"; // Arrays $fruits = ["apple", "banana", "cherry"]; $assoc = ["name" => "Alice", "age" => 30, "city" => "Berlin"]; $matrix = [[1, 2], [3, 4], [5, 6]]; echo "\n"; // Control flow for ($i = 0; $i < 5; $i++) { if ($i % 2 === 0) { echo "{$i} "; } elseif ($i === 3) { echo "{$i} "; } else { echo "{$i} "; } } $day = date("l"); switch ($day) { case "Monday": case "Tuesday": echo "

Weekday early.

\n"; break; case "Saturday": case "Sunday": echo "

Weekend!

\n"; break; default: echo "

Midweek.

\n"; } // Match expression (PHP 8+) $status = 2; $label = match($status) { 1 => "Active", 2 => "Pending", 3, 4 => "Inactive", default => "Unknown", }; echo "

Status: {$label}

\n"; // Functions function factorial(int $n): int { return $n <= 1 ? 1 : $n * factorial($n - 1); } $closure = static function (float $x, float $y): float { return sqrt($x ** 2 + $y ** 2); }; $arrow = fn($a, $b) => $a + $b; echo "

10! = " . factorial(10) . "

\n"; echo "

Hypotenuse(3,4) = " . $closure(3.0, 4.0) . "

\n"; // OOP interface Drawable { public function draw(): string; } abstract class Shape implements Drawable { public function __construct(protected string $color = "black") {} abstract public function area(): float; } class Circle extends Shape { public function __construct(private float $radius, string $color = "red") { parent::__construct($color); } public function area(): float { return M_PI * $this->radius ** 2; } public function draw(): string { return ""; } } $circle = new Circle(5.0, "blue"); echo "

Circle area: " . round($circle->area(), 4) . "

\n"; echo $circle->draw() . "\n"; // Exception handling try { if ($pi > 3) { throw new \InvalidArgumentException("PI is too large for this example!"); } } catch (\InvalidArgumentException $e) { echo "

Caught: " . htmlspecialchars($e->getMessage()) . "

\n"; } catch (\Exception $e) { echo "

General error: " . htmlspecialchars($e->getMessage()) . "

\n"; } finally { echo "\n"; } // Null safe operator, named arguments $users = [["name" => "Bob", "email" => "bob@example.com"]]; $first = $users[0] ?? null; echo "

First user: " . ($first?['name'] ?? "none") . "

\n"; ?> Short echo: Today is " . date("Y-m-d") . "

\n" ?>

Classic ASP — VBScript

<% ' ASP VBScript comment Option Explicit Dim strTitle, intCount, arrItems, i strTitle = "ASP VBScript Demo" intCount = 5 ' Build an array with a loop ReDim arrItems(intCount - 1) For i = 0 To intCount - 1 arrItems(i) = "Item #" & (i + 1) Next ' Output list Response.Write "" & vbCrLf ' Conditional Dim hour hour = Hour(Now()) If hour < 12 Then Response.Write "

Good morning!

" & vbCrLf ElseIf hour < 18 Then Response.Write "

Good afternoon!

" & vbCrLf Else Response.Write "

Good evening!

" & vbCrLf End If ' Function in ASP Function FormatPrice(amount) FormatPrice = "$" & FormatNumber(amount, 2) End Function Response.Write "

Price: " & FormatPrice(19.99) & "

" & vbCrLf %>

Classic ASP — JScript

<%@ language="JScript" %> <% // ASP JScript comment var greeting = "Hello from ASP JScript!"; var numbers = [1, 2, 3, 4, 5]; var sum = 0; for (var i = 0; i < numbers.length; i++) { sum += numbers[i]; } Response.Write("

" + greeting + "

\n"); Response.Write("

Sum of [1..5] = " + sum + "

\n"); // Regex in JScript var emailPattern = /^[\w.-]+@[\w.-]+\.\w{2,}$/; var testEmail = "test@example.com"; Response.Write("

Email valid: " + emailPattern.test(testEmail) + "

\n"); %>

Inline & Event-Handler JavaScript

JavaScript href link

XML / SGML / CDATA

]> E = m c2