This file contains hidden or 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
mysql> SELECT * FROM wizard WHERE birthday BETWEEN '1975-01-01' AND '1985-12-31' AND is_muggle=0; | |
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+ | |
| id | firstname | lastname | birthday | birth_place | biography | is_muggle | | |
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+ | |
| 1 | harry | potter | 1980-07-31 | london | | 0 | | |
| 2 | hermione | granger | 1979-09-19 | | Friend of Harry Potter | 0 | | |
| 4 | ron | weasley | 1980-03-01 | | Best friend of Harry | 0 | | |
| 5 | ginny | weasley | 1981-08-11 | | Sister of Ron and girlfriend of Harry | 0 | | |
| 6 | fred | weasley | 1978-04-01 | | | 0 | | |
| 7 | george | weasley | 1978-04-01 | |
This file contains hidden or 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 $animal1, string $animal2): string | |
{ | |
return $animal1 . " s'incline face au " . $animal2 ; | |
} | |
echo WriteSecretSentence("le loup", "lune") . "<br>"; | |
echo WriteSecretSentence("le lion", "feu") . "<br>"; | |
?> |
This file contains hidden or 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 | |
const BR = '<br/>'; | |
//PHP Procédural - Les conditions | |
$weapons = ['fists', 'whip', 'gun']; | |
$opponentWeapon = $weapons[rand(0,2)]; | |
// Cela permet de choisir une arme de manière aléatoire. | |
echo 'Opponent weapon: '.$opponentWeapon.''; | |
echo BR ; |
This file contains hidden or 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 | |
class Personne{ | |
//créer les variables de la classe | |
private $nom; | |
private $prenom; | |
private $adresse; | |
private $dateDeNaissance; |
This file contains hidden or 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 | |
//index.php | |
if ($_SERVER['REQUEST_METHOD'] == 'POST') | |
{ | |
$errors = []; | |
//nom | |
// (!) pour la négation | |
if (!isset($_POST['nom']) || empty($_POST['nom']) ) |
This file contains hidden or 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 | |
const BR = '<br/>'; | |
$tableau1 = [ | |
"Les Aventuriers de l'arche perdue"=>['Harrison Ford','Karen Allen', 'William Hootkins'], | |
"Indiana Jones et le Temple maudit"=>['Harrison Ford','Kate Capshaw', 'Jonathan Ke Quan'], | |
"Indiana Jones et la Dernière Croisade"=>['Harrison Ford','Sean Connery', 'Alison Doody'], | |
]; | |
foreach ($tableau1 as $key => $value) { |
This file contains hidden or 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 | |
$msg1 = "0@sn9sirppa@#?ia'jgtvryko1"; | |
$msg2 = "q8e?wsellecif@#?sel@#?setuotpazdsy0*b9+mw@x1vj"; | |
$msg3 = "aopi?sgnirts@#?sedhtg+p9l!"; | |
// msg1 | |
// calcul le nombre de carac. et divise par 2. | |
$lenght = strlen($msg1)/2; |
This file contains hidden or 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 | |
$nomFilmVO = 'Indiana Jones and the Last Crusade'; | |
echo $nomFilmVO; | |
echo '<br/>'; | |
$filmVuOuNon = false; | |
echo $filmVuOuNon; | |
echo '<br/>'; |