Skip to content

Instantly share code, notes, and snippets.

View celestecastillo0's full-sized avatar

celestecastillo0

View GitHub Profile
@celestecastillo0
celestecastillo0 / index.php
Last active October 22, 2021 19:51
DeWeb act2 UII
<!DOCTYPE html>
<html>
<body>
<?php
echo "Mi primera vez!";
print ("Mi primera vez!<br>");
$num1 = 7;
$num2 = 20;
$num3 = 3;
@celestecastillo0
celestecastillo0 / index.php
Last active October 23, 2021 08:15
DeWeb act3 UII
<?php
$galletas = true;
if($galletas == true) {
echo 'Hay galletas';
} else {
@celestecastillo0
celestecastillo0 / index.php
Last active October 23, 2021 09:34
DeWeb act3 UII switch case
<?php
$variable=2;
switch($variable) {
case 1:
echo '$variable es igual a 1.';
@celestecastillo0
celestecastillo0 / index.php
Created October 24, 2021 05:39
DeWeb act4 UII do while
<?php
echo 'Hecho con do while <br/>';
$i = 1;
do {
echo $i . "<br/>";
$i++;
} while($i < 10);
echo "<br> Celeste Castillo Flores";
?>
@celestecastillo0
celestecastillo0 / index.php
Last active October 25, 2021 03:28
DeWeb act4 UII for
<?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";
?>
@celestecastillo0
celestecastillo0 / index.php
Created October 25, 2021 14:32
Dwab_UII_poo
<html>
<body>
<?php
class Fruta {
// Properties
public $nombre;
public $color;
// Methods
function Escribe_n($nombre) {
echo"El nombre de la fruta es $nombre <br>";
@celestecastillo0
celestecastillo0 / index.php
Created October 27, 2021 23:51
DeWeb act5 UII función sin parámetro y retorno
<?php
function cuadrado($núm)
{
return $núm * $núm;
}
echo cuadrado(4); // imprime '16'.
echo "<br>Celeste Castillo Flores ";
echo"<br>5J";
?>
@celestecastillo0
celestecastillo0 / index.php
Last active October 28, 2021 01:21
DeWeb act5 UII anonimas
<?php
$saludo = function($nombre)
{
printf("<br>Hola %s\r\n", $nombre);
};
$saludo('Mundo');
$saludo('php');
echo"<br>Celeste Castillo Flores"
?>
@celestecastillo0
celestecastillo0 / index.php
Created October 28, 2021 01:29
DeWeb act5 UII ¿parametros
<?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";
?>
@celestecastillo0
celestecastillo0 / index.php
Created October 28, 2021 20:04
Deweb Act6 UII POO
<!DOCTYPE html>
<html>
<body>
<?php
class Fruta {
public $nombre;
public $color;