Skip to content

Instantly share code, notes, and snippets.

View elneris's full-sized avatar
🚀
Working at Omnilog

Elneris Dang elneris

🚀
Working at Omnilog
View GitHub Profile
<?php
$mesageOne = "0@sn9sirppa@#?ia'jgtvryko1";
$mesageTwo = "q8e?wsellecif@#?sel@#?setuotpazdsy0*b9+mw@x1vj";
$mesageThree = "aopi?sgnirts@#?sedhtg+p9l!";
$numberKeyOne = (strlen($mesageOne))/2;
$underStringOne = substr($mesageOne , 5 , $numberKeyOne ) ;
$stringReplaceOne = str_replace("@#?", " ", $underStringOne);
const movieName = "Stargate";
const releaseYear = 1994;
const directorName = "Roland Emmerich"
const message = movieName + ", réalisé par " + directorName + " est sorti en " + releaseYear;
// Display a popup
alert(message);
2 : /A\./g
3 : /\d{2}\/\d{2}\/[0-9]{4}/g
4 : /\s\d{1}\/\d{2}/g
5 : /\w{14}/gi
6 : /https?://[a-zA-Z0-9\.-]+\.[a-zA-Z]{2,4}(\S[^\)]*)?/gi
<?php
$movies = [
'Indiana Jones and the Kingdom of the Crystal Skull' => [ 'Harisson Ford', 'Cate Blanchett', 'Karen Allen'],
'Indiana Jones and the Last Crusade' => ['Harisson Ford', 'Sean Connery','Denholm Elliott'],
'Indiana Jones and the Temple of Doom' => ['Harisson Ford', 'Kate Capshaw', 'Jonathan Ke Quan']
];
foreach ($movies as $movie => $actor){
echo "Dans le film $movie, les principaux acteurs sont : $actor[0], $actor[1], $actor[2] .<br>";
}
<?php
$weapons = ['fists', 'whip', 'gun'];
$opponentWeapon = $weapons[rand(0,2)];
if ($opponentWeapon === 'fists') {
$indyWeapon = 'gun';
} elseif ($opponentWeapon === 'whip') {
$indyWeapon = 'fists';
} elseif ($opponentWeapon === 'gun') {
<?php
function writeSecretSentence(string $parameter1, string $parameter2) : string
{
return $parameter1.' s\'incline face à '.$parameter2;
}
echo writeSecretSentence('le chien', 'la lune');
?>
-- MySQL dump 10.13 Distrib 8.0.15, for Win64 (x86_64)
--
-- Host: localhost Database: elneris_d_wcs_bdx
-- ------------------------------------------------------
-- Server version 8.0.15
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
SET NAMES utf8mb4 ;
SELECT * FROM movie;
SELECT name FROM movie;
SELECT id,poster FROM movie;
SELECT poster,`comment` AS avis_spectateur FROM movie;
INSERT INTO movie VALUES ('la guerre des etoiles', 'stargate', 'interstellar');
INSERT INTO movie (name, poster, comment) VALUES ('hello', 'je sais pas', 'cest un film sa');
INSERT INTO movie (name, poster, comment) VALUES
('les visiteur', 'ok', 'sympa'),
('les visiteurs 2', 'OK', 'bof'),
('les visiteur 3', 'ok ok', 'nul');
INSERT INTO movie (name) VALUES ('les visiteur 58');
UPDATE movie SET name='Men in Black' WHERE id = 5;
UPDATE movie
SET name='Deadpool', poster='https://upload.wikimedia.org/wikipedia/en/thumb/2/23/Deadpool_%282016_poster%29.png/220px-Deadpool_%282016_poster%29.png'
WHERE id=8;
UPDATE movie
SET comment=""
WHERE id=10;