-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path13-include.php
More file actions
42 lines (41 loc) · 915 Bytes
/
13-include.php
File metadata and controls
42 lines (41 loc) · 915 Bytes
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
<?php
// on va importer un fichier .php contenant nos fonctions
include "nosFonctions1.php";
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>include</title>
</head>
<body>
<h1>include</h1>
<p>include permet d'inclure du code php depuis un fichier externe</p>
<?php
// ne fonctionnera pas car pas le bon nombre d'argument
//addition();
echo addition(7,"r");// une des variable n'est pas numérique, notre fonction nous envoie un message d'erreur
echo "<hr>";
$bon1 = addition (25,50);
echo $bon1;
echo "<hr>";
echo soustraction(15,5);
echo "<hr>";
echo soustraction(37,-8);
echo "<hr>";
echo soustraction(['tab'],-8); // erreur
echo "<hr>";
echo multiplie(10,5);
echo "<hr>";
echo multiplie("d","Bill"); // erreur
echo "<hr>";
echo multiplie(84,16);
echo "<hr>";
echo divise(10,5);
echo "<hr>";
echo divise("d","Bill"); // erreur
echo "<hr>";
echo divise(84,16);
?>
</body>
</html>