我正在尝试创建一个像这样的服务器横幅
我已经厌倦了这里的教程http://php.net/manual/en/image.examples-png.php
但是图片没有显示任何信息或图片没有显示,我从实例开始工作时我能够在html中看到的数据只是回显了图像..
$servers = [
[
'id' => 'CS1',
'banner' => 'b1.png',
'type' => 'CS',
'host' => '74.23.145.219:8777'
]
];
$GameQ = new \GameQ\GameQ();
$GameQ->addServers($servers);
$GameQ->setOption('timeout', 5);
$GameQ->addFilter('normalize');
$results = $GameQ->process();
header("Content-type: image/png");
$results['id']['gq_address'];
$results['id']['gq_port_client'];
$results['id']['gq_name'];
$results['id']['ip'];
$results['id']['online'];
$results['id']['host_name'];
$im = imagecreatefrompng("images/banners/['banner']");
$orange = imagecolorallocate($im, 220, 210, 60);
$px = (imagesx($im) - 7.5 * strlen($results)) / 2;
imagestring($im, 3, $px, 9, $results, $orange);
imagepng($im);
imagedestroy($im);
链路
<img src="../includes/create_banner.php?gq_address=gq_port_client">