Golfier
parent
e2d7ef8992
commit
b5af5dbc20
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
class MyDB extends SQLite3
|
||||||
|
{
|
||||||
|
function __construct()
|
||||||
|
{
|
||||||
|
$this->open('mysqlitedb.db');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function genererChaineAleatoire($longueur = 10)
|
||||||
|
{
|
||||||
|
$caracteres = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||||
|
$longueurMax = strlen($caracteres);
|
||||||
|
$chaineAleatoire = '';
|
||||||
|
for ($i = 0; $i < $longueur; $i++)
|
||||||
|
{
|
||||||
|
$chaineAleatoire .= $caracteres[rand(0, $longueurMax - 1)];
|
||||||
|
}
|
||||||
|
return $chaineAleatoire;
|
||||||
|
}
|
Loading…
Reference in new issue