Bonjour à tous
Ce code affiche: "The greetings is ." au lieu de "The greetings is bonsoir ."
L'erreur est-elle dans cette ligne:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Forme.php --> <!-- our first php class --> <?php class Forme { function __construct( $inValue ) { $prems = $inValue ; } function testForme() { echo "The greetings is $prems ."; } } $prems = "Bonjour"; $myObject_soir = new Forme ( "Bonsoir" ); $myObject_soir->testForme(); ?> <?php $name = "UniversalBitMapper"; ?> <html xmlns = "http://www.w3.org/1999/xhtml"> <head> <title>A simple PHP document</title> </head> <body style = "font-size: 2em"> <p> <strong> <!-- print variable name's value --> Welcome to php, <?php print( "$name" ); ?>! </strong> </p> </body> </html>
echo "The greetings is $prems .";
Merci d'avance
Bonne journée
Partager