You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
1.2 KiB
72 lines
1.2 KiB
<!DOCTYPE html>
|
|
<html lang="cs">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Ahoj světe!</title>
|
|
</head>
|
|
<?php
|
|
$color = "green";
|
|
?>
|
|
<body style="background-color: <?php echo $color ?>;">
|
|
|
|
<?php
|
|
// vypsat aktuální datum
|
|
// set the default timezone to use.
|
|
date_default_timezone_set('Europe/Prague');
|
|
// Prints something like: Monday 8th of August 2005 03:12:46 PM
|
|
echo date('Y-m-d H:i:s');
|
|
|
|
echo "<br>";
|
|
|
|
|
|
$images = [
|
|
"earth1.webp",
|
|
"earth2.jfif",
|
|
"earth3.jpg",
|
|
];
|
|
|
|
$random_index = random_int(0, count($images) - 1);
|
|
|
|
// var_dump($images);
|
|
|
|
$random_image = $images[$random_index];
|
|
|
|
?>
|
|
|
|
<img src="<?php echo $random_image; ?>" alt="Earth image" width="300">
|
|
|
|
<?php
|
|
// echo date("Ymd");
|
|
|
|
$name_days = [
|
|
20241002 => "Olívie, Olivia, Oliver",
|
|
20241003 => "Bohumil",
|
|
// ...
|
|
20241016 => "Havel",
|
|
// ...
|
|
];
|
|
|
|
echo "<h2>Dnes má svátek: " . $name_days[date("Ymd")] . "</h2>";
|
|
|
|
?>
|
|
|
|
<h2>Výpis obsahu adresáře</h2>
|
|
|
|
<?php
|
|
|
|
$dir = '.';
|
|
$files1 = scandir($dir);
|
|
// print_r($files1);
|
|
|
|
echo "<ul>";
|
|
foreach ($files1 as $item) {
|
|
echo "<li>$item</li>";
|
|
}
|
|
echo "</ul>";
|
|
|
|
?>
|
|
|
|
</body>
|
|
</html>
|
|
|
|
|