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
<?php | |
$intnum=1; | |
echo "<table>"; | |
do{ | |
$intmultiplica= $intnum * 8; | |
echo "<tr>"; | |
echo "<td>8</td>"; | |
echo "<td>X</td>"; | |
echo "<td>$intnum</td>"; | |
echo "<td>=</td>"; |
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
<?php | |
$numero = 0; | |
//Pondremos la variable en 0 | |
while($numero < 10) { | |
$numero++; | |
//Se incrementa $numero en uno | |
echo "El valor de numero es = <b> ".$numero."</b></br> "; | |
//Imprime los valores del ciclo |
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
<?php | |
$colores = "Amarillo"; | |
switch($colores){ | |
case "Azul": | |
echo "Yo soy el color azul"; | |
break; | |
case "Amarillo": | |
echo "Yo soy el color amarillo"; |
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
<?php | |
$hora = date("H"); | |
if ($hora < "11") { | |
echo "Buenos días"; | |
} | |
elseif ($hora < "15") | |
{ | |
echo "Es mediodía"; | |
} |
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
<?php | |
echo "Mi primera vez!"; | |
print("Mi primera vez!"); | |
$num1 = 7; | |
$num2 = 20; | |
$num3 = 3; | |
$num1++ ; | |
echo "El valor de 'num1' ahora es: [".$num1."]</br>"; | |
$num1 += 3; | |
echo "El valor de 'num1' ahora es: [".$num1."]<p/>"; |
NewerOlder