Php 函数不用于创建图像
我们可以使用文本参数调用imagestring中的函数吗Php 函数不用于创建图像,php,Php,我们可以使用文本参数调用imagestring中的函数吗 imagestring($im, 5, 5, 5, **$graph->createGraph()**, $text_color) 或 创建函数图像作为数据输出的另一种方法?检查此项 <?php header("Content-Type: image/png"); $im = @imagecreate(110, 20) or die("Cannot Initialize new GD image stream");
imagestring($im, 5, 5, 5, **$graph->createGraph()**, $text_color)
或
创建函数图像作为数据输出的另一种方法?检查此项
<?php
header("Content-Type: image/png");
$im = @imagecreate(110, 20)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng($im);
imagedestroy($im);
?>
如果该函数调用返回一个字符串,那么显然可以根据imagestring文档进行修改。那么你真正的问题是什么?这个论点必须是一个文本字符串。似乎不太可能名为createGraph的东西会返回文本。我正在尝试使用imagestring创建图像,而它的文本参数使用函数outputh。这解决了他的问题吗?他问你是否可以调用一个函数而不是提供一个简单的文本字符串。