This repository has been archived on 2025-10-20. You can view files and clone it, but cannot push or open issues or pull requests.
Files
2bki21/progp/24-10-17- switch_case/switch-case.php
2024-11-14 10:03:28 +01:00

32 lines
765 B
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
$b = 1;
if ($b == 0){
echo "Variable b hat den Wert 0. <br>";
}
else if ($b == 1){
echo "Variable b hat den Wert 1. <br>";
} else if ($b == 2){
echo "Variable b hat den Wert 2. <br>";
}
$i = 1;
switch ($i) {
case 2:
case 4:
case 6:
echo "Variable b hat den Wert 2. <br>";
break;
default:
echo "Variable b hat einen unbekannten Wert. <br>";
}
?>
</body>
</html>