Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function genere_nom_pl(){
- $mots = array("bleu","blanc","rouge","jaune","vert","violet","affichera",
- "chaine","genre","retourne","fonction","commentaire","lapin","renard","image",
- "mathematique","aleatoire","hasard","source","chat","souris","chapeau","langue",
- "arbre","generer","livre","supposon","tout","vecteur","construction","violon",
- "flute","fuite","zebre","zoro","xylophone","deux","trois","quatre","cinq","sept"
- ,"huit","neuf","douze","treize", "star", "etoile", "maska", "wistaro", "vaisseau", "machin", "bidule", "pooo", "xylophone", "classement", "youtube", "marcel", "ordinateur", "camera", "marron", "william", "kevin", "kapla", "fou", "findus", "fuite", "fonction", "programme", "papa", "maman", "physique");
- $p = 2;
- $m1 = $mots[rand(0,count($mots)-1)];
- $result=substr($m1,0,rand(2,strlen($m1)-1));
- for($i=0;$i<rand(3,4);$i++){
- $pasOk=true;
- $x =0;
- while($pasOk && $x<100){
- $m = $mots[rand(0,count($mots)-1)];
- while($m==$m1){
- $m = $mots[rand(0,count($mots)-1)];
- }
- if(eregi(substr($result,-$p),$m)){
- $pasOk=false;
- $m2 = split(substr($result,-1),$m);
- $result .= substr($m2[1],0,rand(2,strlen($m2[1])-1));
- }
- $x++;
- } if($x==100){ return genere_nom_pl;}
- }
- if(strlen($result)<4) return genere_nom_pl();
- return $result;
- }
- $distinction = rand(10, 100);
- $nom_final = genere_nom_pl().$distinction;
- echo $nom_final;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement