Example #1
0
<?php

require_once "../ej1/ej1.php";
if ($_REQUEST["metodo"] == 1) {
    echo conjugar($_REQUEST["verbo"]);
} else {
    $verbo = $_REQUEST["verbo"];
    if (substr($verbo, -2, 2) == "ar") {
        $conjugacion = "1ª conjugación";
    }
    if (substr($verbo, -2, 2) == "er") {
        $conjugacion = "2ª conjugación";
    }
    if (substr($verbo, -2, 2) == "ir") {
        $conjugacion = "3ª conjugación";
    }
    echo $conjugacion;
}
Example #2
0
$arrayVerbos = $_REQUEST["todosVerbos"];
$arrayVerbos = explode("&", $arrayVerbos);
array_shift($arrayVerbos);
foreach ($arrayVerbos as $verbo) {
    if (substr($verbo, -2, 2) == "ar") {
        $conjugacion = "1";
    }
    if (substr($verbo, -2, 2) == "er") {
        $conjugacion = "2";
    }
    if (substr($verbo, -2, 2) == "ir") {
        $conjugacion = "3";
    }
    $conjugar = conjugar($verbo);
    $tablaVerbos .= "<tr><td>{$verbo}</td><td>{$conjugacion}</td><td>{$conjugar}</td></tr>" . PHP_EOL;
}
$verbo = $_REQUEST["verbo"];
if (substr($verbo, -2, 2) == "ar") {
    $conjugacion = "1";
}
if (substr($verbo, -2, 2) == "er") {
    $conjugacion = "2";
}
if (substr($verbo, -2, 2) == "ir") {
    $conjugacion = "3";
}
$conjugar = conjugar($verbo);
$tablaVerbos .= "<tr><td>{$verbo}</td><td>{$conjugacion}</td><td>{$conjugar}</td></tr>" . PHP_EOL;
$tablaVerbos .= "</table>";
echo $tablaVerbos;
echo "<br/><a href=\"ej2.php\">Volver a introducir verbos</a>";
Example #3
0
<?php

require_once "ej1.php";
echo conjugar("saltar");
echo conjugar("comer");
echo conjugar("vivir");
echo conjugar("amar");
echo conjugar("romper");
echo conjugar("fundir");
Example #4
0
<?php

include '../ej01/util.php';
session_start();
$verbosIntroducidos = isset($_SESSION['verbos']) ? $_SESSION['verbos'] : null;
$verbos = explode("#", $verbosIntroducidos);
echo "<h2>Lista de verbos</h2>";
echo "<table border=\"1\"><tr><th>Infinitivo</th><th>Conjugacion</th><th>Presente de indicativo</th></tr>";
for ($i = 0; $i < sizeof($verbos) - 1; $i++) {
    echo "<tr><td>{$verbos[$i]}</td><td>" . conjugaciones($verbos[$i]) . "</td><td>" . conjugar($verbos[$i]) . "</td></tr>";
}
echo "</table>";
echo <<<FORM
<form action="formulario.php">
\t<input type="submit" name="destruirSesion" value="Volver a introducir verbos" />
</form>
FORM
;
<?php

include '../ej01/util.php';
$verbo = isset($_REQUEST['verbo']) ? $_REQUEST['verbo'] : null;
echo conjugar($verbo);