在PHP中以图像垂直居中文本

时间:2014-05-18 20:21:12

标签: php gd

我有以下简单的PHP函数来获取文本框的坐标,使其水平和垂直居中。

$box_coo = imagettfbbox(25, 0, 'arial.ttf', $string);
$box_width = $box_coo[2] - $box_coo[0];
$box_height = $box_coo[7] - $box_coo[1];

水平中心但不垂直。 Aren选择的Y坐标是否正确?

由于

0 个答案:

没有答案