Skip to content

Instantly share code, notes, and snippets.

@dilakv
Created February 5, 2021 14:22
Show Gist options
  • Save dilakv/d27e3dc05057f12fcdb6d0b1c37883c0 to your computer and use it in GitHub Desktop.
Save dilakv/d27e3dc05057f12fcdb6d0b1c37883c0 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Curso - PHP - For</title>
</head>
<body>
<?php
# Estructuras Repetitivas
# For
$i = 0;
while ($i < 10) {
// Incremento o condición cambia aquí
//$i += 1;
$i++;
}
$numero = 0;
for ($i = 0; $i < 10; $i++) {
if ($numero % 2 == 0) {
echo "Número par => $numero <br />";
}
$numero++;
}
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment