This file contains 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> | |
<body> | |
<?php | |
echo "Mi primera vez!"; | |
print ("Mi primera vez!<br>"); | |
$num1 = 7; | |
$num2 = 20; | |
$num3 = 3; |
This file contains 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 | |
$galletas = true; | |
if($galletas == true) { | |
echo 'Hay galletas'; | |
} else { |
This file contains 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 | |
$variable=2; | |
switch($variable) { | |
case 1: | |
echo '$variable es igual a 1.'; |
This file contains 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 'Hecho con do while <br/>'; | |
$i = 1; | |
do { | |
echo $i . "<br/>"; | |
$i++; | |
} while($i < 10); | |
echo "<br> Celeste Castillo Flores"; | |
?> |
This file contains 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 | |
for ($date = strtotime("2021-09-08"); $date < strtotime("2021-10-08"); $date = strtotime("+1 day", $date)) { | |
echo date("Y-m-d", $date)."<br />"; | |
} | |
echo "<br> Celeste Castillo Flores"; | |
?> |
This file contains 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
<html> | |
<body> | |
<?php | |
class Fruta { | |
// Properties | |
public $nombre; | |
public $color; | |
// Methods | |
function Escribe_n($nombre) { | |
echo"El nombre de la fruta es $nombre <br>"; |
This file contains 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 | |
function cuadrado($núm) | |
{ | |
return $núm * $núm; | |
} | |
echo cuadrado(4); // imprime '16'. | |
echo "<br>Celeste Castillo Flores "; | |
echo"<br>5J"; | |
?> |
This file contains 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 | |
$saludo = function($nombre) | |
{ | |
printf("<br>Hola %s\r\n", $nombre); | |
}; | |
$saludo('Mundo'); | |
$saludo('php'); | |
echo"<br>Celeste Castillo Flores" | |
?> |
This file contains 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 | |
function hacercafé($tipo = "capuchino") | |
{ | |
return "Hacer una taza de $tipo,\n"; | |
} | |
echo hacercafé(); | |
echo hacercafé(null); | |
echo hacercafé("espresso"); | |
echo"<br> Celeste Castillo Flores"; | |
?> |
This file contains 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> | |
<body> | |
<?php | |
class Fruta { | |
public $nombre; | |
public $color; |
OlderNewer