Skip to content

Instantly share code, notes, and snippets.

@HiramJJG
Created October 2, 2023 18:47
Show Gist options
  • Save HiramJJG/a106acf5590096bdb37668ba01f17521 to your computer and use it in GitHub Desktop.
Save HiramJJG/a106acf5590096bdb37668ba01f17521 to your computer and use it in GitHub Desktop.
Usando Ciclo for y ForEach
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<?php
echo "<h2>Jurado Garcia Hiram Jaziel Ciclo For</h2>";
echo "<h2>Año 2006 Mes 11 dia 16<br></h2>";
for ($x = 0; $x <= 16; $x++) {
echo "El numero es: $x <br>";
}//Fin de for
echo "<h2>Ejemplo 2 Con Asignacion de Implemento</h2>";
for ($H = 0; $H <=17; $H+=2) {
echo "El numero es: $H <br>";
}//Fin de la Variable H
echo "<h2>Ejemplo ForEach<br></h2>";
$Animales = array("leon", "toro", "perro", "gato");
foreach ($Animales as $hiram) {
echo "$hiram <br>";
}
?>
</body>
</html>
@HiramJJG
Copy link
Author

HiramJJG commented Oct 2, 2023

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment