Skip to content

Instantly share code, notes, and snippets.

View Komche's full-sized avatar
🎯
Focusing

Komche Komche

🎯
Focusing
View GitHub Profile
@Komche
Komche / ValidLuhn.php
Last active August 2, 2019 13:59
This function check if the number is a valid luhn
<?php
/**
* @param string $val
* @return bool
*/
function checkIsValidLuhn($val)
{
$i = 0;
$arr = str_split($val);
<?php
//fonction pour ce connecter à une base de donnée en utilisant la methode PDO
function db()
{
$db = 'nom_de_la_base_de_donne';
$user_ = 'nom_d_utilisateur';
$pass = 'mot_de_passe';
$host = 'localhost';
try {