2024-01-21 22:41:16 -05:00
|
|
|
<?php
|
2024-01-22 22:11:45 -05:00
|
|
|
echo "<!DOCTYPE html>\n";
|
|
|
|
echo "<html lang=\"en\">\n";
|
|
|
|
echo "<!-- This is a simple PHP template -->\n";
|
2024-01-21 22:41:16 -05:00
|
|
|
// This section could also use <?= syntax, but for example's sake, will not.
|
|
|
|
?>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<title><?= ucfirst(basename(__FILE__, '.php')) ?></title>
|
|
|
|
<link rel="stylesheet" href="css/style.css">
|
|
|
|
<meta name="description" content="">
|
|
|
|
|
|
|
|
<meta property="og:title" content="">
|
|
|
|
<meta property="og:type" content="">
|
|
|
|
<meta property="og:url" content="">
|
|
|
|
<meta property="og:image" content="">
|
|
|
|
|
|
|
|
<link rel="icon" href="/favicon.ico" sizes="any">
|
|
|
|
<link rel="icon" href="/icon.svg" type="image/svg+xml">
|
|
|
|
<link rel="apple-touch-icon" href="icon.png">
|
|
|
|
|
|
|
|
<link rel="manifest" href="site.webmanifest">
|
|
|
|
<meta name="theme-color" content="#fafafa">
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
<h1>Hello world!</h1>
|
|
|
|
|
2024-01-22 22:11:45 -05:00
|
|
|
<p>This page was rendered on <?= date("Y-m-d") ?></p>
|
2024-01-21 22:41:16 -05:00
|
|
|
|
|
|
|
<pre><?php
|
|
|
|
$pairs = [
|
|
|
|
"hello" => "world!",
|
|
|
|
"how are" => "you?",
|
|
|
|
"i like the number" => 3
|
|
|
|
];
|
|
|
|
|
|
|
|
// Iterate over key-value pairs
|
|
|
|
foreach ($pairs as $k => $v) {
|
|
|
|
echo "($k, $v) ";
|
|
|
|
}
|
|
|
|
echo "\n\n";
|
|
|
|
|
|
|
|
// Iterate over keys
|
|
|
|
foreach (array_keys($pairs) as $key) {
|
|
|
|
echo "$key: $pairs[$key]\n";
|
|
|
|
}
|
|
|
|
echo "\n";
|
|
|
|
|
|
|
|
// Iterate over values
|
|
|
|
foreach ($pairs as $value) {
|
|
|
|
echo "values = $value\n";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|