-
Notifications
You must be signed in to change notification settings - Fork 0
/
pismena3.php
58 lines (47 loc) · 1000 Bytes
/
pismena3.php
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<form action="" method="POST">
<textarea name="text" cols="40" rows="10">
</textarea>
<!--<input type="text" name="text"/>-->
<input type="submit" value="zobrazit"/>
</form>
<span style="font-family: Courier New;">
<?php
$textt = strtoupper($_POST["text"]);
if($text){
$textt = split("[
]",$textt);
foreach($textt as $text){
$size = 5;
//echo($_SESSION["obrazokk"]);
$h = 25;
$w = $size*strlen($text)*1.8;
$im = ImageCreate($w, $h);
$b = ImageColorAllocate($im,0xFF,0xFF,0xFF);
$farba = ImageColorAllocate($im,0,0,0);
ImageFill($im,0,0,$b);
ImageString($im,$size,1,1,$text,$farba);
$hh = 0;
while($hh != $h){
$hh=$hh+1;
$ww = 0;
if($hh>3 AND $hh<14){
while($ww != $w){
$ww=$ww+1;
if(imagecolorat($im, $ww ,$hh)){
echo(substr($text,intval($ww/((9/5)*$size)),1));
}else{
echo(" ");
//echo("_");
}
}
echo("<br />");
}
}
//header("Content-type: image/png");
//ImagePng($im);
//ImageDestroy($im);
echo("<br />");
}
}
?>
</span>