Bonjour,

j'ai ce morceau de code qui permet de générer une image pour un système anti-flood cependant il affiche le texte trop proprement ! Peut-on y ajouter des éléments tels que barre obliques, cadrillage, ou ce qui m'intéresserait, serait de modifier les caractères en les ondulant ? Merci !

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
session_start();
function strrand($length)
{
	$str = "";
 
	while(strlen($str)<$length){
	$random=rand(48,122);
	if( ($random>47 && $random<58)  ){
	$str.=chr($random);
	} 
 
	}
 
	return $str;
}
 
$text = $_SESSION['string']=strrand(5);
$img_number = imagecreate(47,17);
$backcolor = imagecolorallocate($img_number,244,244,244);
$textcolor = imagecolorallocate($img_number,0,0,0);
 
imagefill($img_number,0,0,$backcolor);
 
Imagestring($img_number,50,1,1,$text,$textcolor);
 
header("Content-type: image/png");
imagejpeg($img_number);
?>
Je fais appel à votre imagination !