This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function writeSecretSentence(string $param1, string $param2) { | |
return $param1 . " s'incline face à " . $param2 . '.'; | |
} | |
echo writeSecretSentence('Le lion', 'la licorne'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$weapons = ['fists', 'whip', 'gun']; | |
$opponentWeapon = $weapons[rand(0,2)]; // Cela permet de choisir une arme de manière aléatoire. | |
// TODO | |
switch ($opponentWeapon) { | |
case 'fists': | |
$indyWeapon = 'gun'; | |
echo '$opponentWeapon: ' . $opponentWeapon . nl2br("\n") . '$indyWeapon: ' . $indyWeapon ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$filmography = [ | |
'Indiana Jones and the Last Crusade' => ['Harrison Ford', 'Sean Connery', 'Alison Doody'], | |
'Raiders of the Lost Ark' => ['Harrison Ford', 'Karen Allen', 'Paul Freeman'], | |
'Indiana Jones and the Temple of Doom' => ['Harrison Ford', 'Kate Capshaw', 'Ke Huy Quan'] | |
]; | |
//for ($i=0; $i<3; $i++) { | |
// echo 'Dans le film ' . $filmography[$i]; | |
// echo 'Dans le film ' . $filmography[$i] . ', les principaux acteurs sont : ' . $filmography[$i][0] . ', ' . $filmography[$i][1] . ', ' . $filmography[$i][2] . '.'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$messages = ["0@sn9sirppa@#?ia'jgtvryko1", "q8e?wsellecif@#?sel@#?setuotpazdsy0*b9+mw@x1vj", "aopi?sgnirts@#?sedhtg+p9l!"]; | |
$keyNumber1 = strlen( $messages[0] ) / 2; | |
$subString1 = substr ($messages[0] , 5 , $keyNumber1); | |
$spaceAdded1 = str_replace("@#?", " ", $subString1); | |
$decryptedMessage1 = strrev($spaceAdded1); | |
echo '$decryptedMessage1 : ' . $decryptedMessage1 . nl2br("\n"); | |
$keyNumber2 = strlen( $messages[1] ) / 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$movieName="Indiana Jones and the Last Crusade"; | |
$didSeeIt = true; | |
$released = 1989; | |
$rating = 8.2; | |
echo $movieName; | |
echo nl2br("\n"); | |
echo var_dump($didSeeIt); | |
echo nl2br("\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
const bodyParser = require('body-parser'); | |
const router = require('./routes'); | |
app.use(bodyParser.urlencoded()); | |
app.use('/', router); | |
app.listen(3000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
const bodyParser = require('body-parser'); | |
const router = require('./routes'); | |
app.use(bodyParser.urlencoded()); | |
app.use('/', router); | |
app.listen(3000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CHALLENGE EXPRESS 5 | |
const express = require('express'); | |
const app = express(); | |
const port = 4000; | |
const connection = require('./conf.js') | |
const bodyParser = require('body-parser'); | |
app.use(bodyParser.json()); | |
app.use(bodyParser.urlencoded({ | |
extended: true | |
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Supprimer le film ayant l'ID 5 | |
DELETE FROM movie WHERE id="5"; | |
Supprimer les films dont l'ID est supérieur à 10 | |
DELETE FROM movie WHERE id>"10"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
const port = 3000; | |
const connection = require('./conf.js') | |
const bodyParser = require('body-parser'); | |
// Support JSON-encoded bodies | |
app.use(bodyParser.json()); | |
// Support URL-encoded bodies | |
app.use(bodyParser.urlencoded({ | |
extended: true |
NewerOlder