diff --git a/R3.01/tp/tp1/ex1/hello-world.php b/R3.01/tp/tp1/ex1/hello-world.php
index 11a784f..183c053 100644
--- a/R3.01/tp/tp1/ex1/hello-world.php
+++ b/R3.01/tp/tp1/ex1/hello-world.php
@@ -1,9 +1,9 @@
-
- hello world !!!";
- //phpinfo();
- ?>
-
+
+ hello world !!!";
+ phpinfo();
+ ?>
+
diff --git a/R3.01/tp/tp1/ex2/index.php b/R3.01/tp/tp1/ex2/index.php
index 90e8baa..83fc42a 100644
--- a/R3.01/tp/tp1/ex2/index.php
+++ b/R3.01/tp/tp1/ex2/index.php
@@ -1,17 +1,19 @@
"Paul",
- 2 =>"Martin",
- "Arnaud"
+$clients = [
+ "Luc",
+ 7 => "Paul",
+ 2 =>"Martin",
+ "Arnaud"
];
+var_dump($clients);
+
$produits = [
- 20 => "Chemise",
- 3 => "Pantalon",
- 10 => "Jupe",
- "Veste",
- "Blouson"
+ 20 => "Chemise",
+ 3 => "Pantalon",
+ 10 => "Jupe",
+ "Veste",
+ "Blouson"
];
$array = ["a","b","c"];
$array[] = "d";
@@ -23,4 +25,27 @@ print_r($clients);
print_r($produits);
print_r($array);
echo "";
+
+// Exercice 2.1
+$tab = [];
+$somme = 0;
+for ($i = 0; $i < 10; $i++) {
+ $somme += $i; // somme des entiers de 0 à i
+ $tab[$i] = $somme; // la clé i contient cette somme
+}
+print_r($tab);
+
+
+// Exercice 2.2
+for ($debut = 1; $debut <= 50; $debut += 10) {
+ echo "";
+ for ($i = $debut; $i < $debut + 10; $i++) {
+ if ($i % 2 === 0) {
+ echo "$i ";
+ } else {
+ echo "$i ";
+ }
+ }
+ echo "
";
+}
?>
diff --git a/R3.01/tp/tp1/ex3/index.php b/R3.01/tp/tp1/ex3/index.php
index f031367..55f0ee4 100644
--- a/R3.01/tp/tp1/ex3/index.php
+++ b/R3.01/tp/tp1/ex3/index.php
@@ -3,36 +3,53 @@ include './include/data.inc.php';
?>
-
-
-
- tp1 - ex3
-
-
-
-
-
- Exercice 3 : IMC
-
-
-
- | Nom |
- Prénom |
- Email |
- Taille |
- Poids |
- IMC |
-
-
-
+
+
+
+ tp1 - ex3
+
+
+
+
+
+ Exercice 3 : IMC
+
+
+
+ | Nom |
+ Prénom |
+ Email |
+ Taille |
+ Poids |
+ IMC |
+
+
+
+
+
+
-
-
-
-
-
+ $imc = null;
+ if ($tailleM > 0) {
+ $imc = $poids / ($tailleM * $tailleM);
+ }
+ ?>
+
+ | = $person['Nom'] ?> |
+ = $person['Prenom'] ?> |
+ = $person['Email'] ?> |
+ = $person['Taille'] ?> |
+ = $person['Poids'] ?> |
+ = round($imc, 2) ?> |
+
+
+
+
+
+
diff --git a/R3.01/tp/tp1/ex4/index.php b/R3.01/tp/tp1/ex4/index.php
index 1db7b37..18c1bbf 100644
--- a/R3.01/tp/tp1/ex4/index.php
+++ b/R3.01/tp/tp1/ex4/index.php
@@ -1,3 +1,19 @@
+ 'dice-six-faces-one.svg',
+ 2 => 'dice-six-faces-two.svg',
+ 3 => 'dice-six-faces-three.svg',
+ 4 => 'dice-six-faces-four.svg',
+ 5 => 'dice-six-faces-five.svg',
+ 6 => 'dice-six-faces-six.svg',
+];
+?>
@@ -13,12 +29,12 @@
-
+
-
-
+
+
- Somme =
+ Somme = = $sum ?>
diff --git a/R3.01/tp/tp1/ex6/include/fonction.php b/R3.01/tp/tp1/ex6/include/fonction.php
index 10aaf04..2c0856b 100644
--- a/R3.01/tp/tp1/ex6/include/fonction.php
+++ b/R3.01/tp/tp1/ex6/include/fonction.php
@@ -1,7 +1,7 @@