Created
October 2, 2023 18:47
-
-
Save HiramJJG/a106acf5590096bdb37668ba01f17521 to your computer and use it in GitHub Desktop.
Usando Ciclo for y ForEach
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
Author
HiramJJG
commented
Oct 2, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment