S
S
samorez7772018-03-30 17:34:38
PHP
samorez777, 2018-03-30 17:34:38

Image informer in php (text overlay from MySql), perhaps?

Help with an example of outputting text from a table to an image /page/?id=1, Many thanks to all!
?id=1

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Boris Syomov, 2018-03-30
@kotomyava

Of course it is possible, for example using php.net/manual/ru/function.imagettftext.php

O
Oleg, 2018-03-31
@402d

// получить данные из базы
... $hits .... $users ........
// описание шаблона
$data = 'R0lGODlhWAAfANUAAPT.............';
$hitsx=5;
$hitsy=5;
$usersx=5;
$usersy=15;
$r_f = 86; $g_f = 86; $b_f = 86; // серые буквы
// формирование
$data = base64_decode($data);
$im = imagecreatefromstring($data);
$color = imagecolorallocate($im, $r_f, $g_f, $b_f);
Imagestring($im,3,$hitsx,$hitsy,$hits,$color);
Imagestring($im,3,$usersx,$usersy,$users,$color);
imagegif($im);
imagedestroy($im);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question