Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/237.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 函数不用于创建图像_Php - Fatal编程技术网

Php 函数不用于创建图像

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中的函数吗

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。这解决了他的问题吗?他问你是否可以调用一个函数而不是提供一个简单的文本字符串。