Desafio for
This commit is contained in:
33
exemplos/gabriel_henrique/desafio-for.php
Normal file
33
exemplos/gabriel_henrique/desafio-for.php
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="pt-BR">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Contagem Regressiva</title>
|
||||||
|
<style>
|
||||||
|
.alerta {
|
||||||
|
color: red;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
for ($i = 10; $i >= 1; $i--) {
|
||||||
|
|
||||||
|
// Destacar os 3 últimos segundos
|
||||||
|
if ($i <= 3) {
|
||||||
|
echo "<h3 class='alerta'>$i</h3>";
|
||||||
|
} else {
|
||||||
|
echo "<h3>$i</h3>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mensagem final
|
||||||
|
echo "<h1>FOGUETE LANÇADO! </h1>";
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
5
exemplos/gabriel_henrique/for.php
Normal file
5
exemplos/gabriel_henrique/for.php
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
for ($i = 1; $i <= 5; $i++){
|
||||||
|
echo "teste $i<br>";
|
||||||
|
}
|
||||||
|
?>
|
||||||
Reference in New Issue
Block a user