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 | |
class TimeTravel | |
{ | |
private $start; | |
private $end; | |
public function __construct(DateTime $start, DateTime $end) | |
{ | |
$this->setStart($start); |
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
/([A-Z])[.]{1}/g | |
Thomas A. Anderson | |
/([0-9]{2}\/[0-9]{2}\/[0-9]{4})/g | |
Il est né le 31/03/1999 | |
la date du 31/06/2018 est passée | |
/(\s[0-9]{1}\/[0-9]{2})/g | |
il ne s'agit pas de chercher directement le texte 9/10, mais de chercher un chiffre et un slash, suivi de deux chiffres. | |
fait le 30/05/1999 |
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
function showPopUP(){ | |
const myFavoriteMovie = 'Avenger'; | |
const parutionYear = 2018; | |
const realisator = 'Joe Russo'; | |
let sentence = 'Mon film préféré est : ' + myFavoriteMovie + '. IL a été réalisé par ' + realisator + ' en ' + parutionYear + '.'; | |
alert(sentence); | |
} |
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
SELECT name, COUNT(name) as nb_joueur FROM player | |
INNER JOIN team ON player.team_id = team.id GROUP BY name ORDER BY nb_joueur DESC; | |
+------------+-----------+ | |
| name | nb_joueur | | |
+------------+-----------+ | |
| Gryffindor | 36 | | |
| Slytherin | 21 | | |
| Ravenclaw | 15 | | |
| Hufflepuff | 12 | | |
+------------+-----------+ |
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
SELECT lastname,firstname,role,name FROM player | |
-> INNER JOIN wizard ON wizard.id = player.wizard_id | |
-> INNER JOIN team ON team.id=player.team_id ORDER BY name,role,lastname, firstname ASC; | |
+-----------------+-------------+--------+------------+ | |
| lastname | firstname | role | name | | |
+-----------------+-------------+--------+------------+ | |
| Black | Sirius | beater | Gryffindor | | |
| Brown | Lavender | beater | Gryffindor | | |
| Finnigan | Seamus | beater | Gryffindor | | |
| Hagrid | Rubeus | beater | Gryffindor | |
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
Multi Files Upload ( Quete : Laisse pas trainer ton file ) | |
Second jet : Formulaire et traitement de l'upload pour un ou plusieurs fichiers. | |
=> Ne pas oublier selon l'importance des fichier à upload de modifier le fichier php.ini |
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
Simple File Upload ( Quete : Laisse pas trainer ton file ) | |
Premier jet : Formulaire et traitement de l'upload pour un seul fichier. | |
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 | |
namespace Animals; | |
class Cat | |
{ | |
const FATIGUE_MAX = 100; | |
const FATIGUE_MIN = 0; | |
const FATIGUE_INCR = 10; | |
const FATIGUE_DECR = 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
Enregistrement des rows en bdd : | |
INSERT INTO school (name, capacity, country) | |
VALUES ('Ilvermorny School of Witchcraft and Wizardry',300,'USA'), | |
('Koldovstoretz',125,'Russia'), | |
('Mahoutokoro School of Magic',800,'Japan'), | |
('Uagadou School of Magic',350,'Uganda'); | |
Modification du Champ country la ou name = Durmstrang Institute: | |
UPDATE school SET country = 'Sweden' WHERE name='Durmstrang Institute'; |
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
Récupère tous les champs pour les sorciers nés entre 1975 et 1985 : | |
SELECT * FROM wizard WHERE is_muggle = 0 AND birthdate BETWEEN '1975-01-01' AND '1985-01-01' | |
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+ | |
| id | firstname | lastname | birthdate | 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 | | |
NewerOlder