-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexo1tp2.php
executable file
·48 lines (43 loc) · 1.21 KB
/
exo1tp2.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
//EXO1
//Q1
// t=["lundi","mardi","mercredi","jeudi","vendredi","samedi","dimanche"];
$bd2=3;
$bd=array("lundi","mardi","mercredi","jeudi","vendredi","samedi","dimanche");
foreach ($bd as $i)
echo $i."<br>";
//Q2
/*function afficheTab($tab){
if(is_array($tab)){
foreach ($tab as $i)
echo $i."<br>";
}else { echo "khawma lo dougal wayé dou tableau";}
}
afficheTab($bd);
//Question 3
/* $tab=array(1,2,3,4,5,6,7);
function somme($tab){
$s=0;
foreach($tab as $i)
$s=$s+$i;
echo $s."<br>";
}
function multi($tab){
$m=1;
foreach($tab as $i)
$m=$m*$i;
echo $m;
}
somme($tab);
multi($tab);*/
//Q4
/* $bd=array(
'nom'=>'fall',
'prenom'=>'yacine',
'login'=>'fallzo',
'password'=> 'passer1234'
);
foreach ($bd as $i=>$valeur)
{echo $i."=>".$valeur."</br>";}*/
////////////////////////////////////// EXO2\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
?>