我是这里的初学者,需要帮助。我有这段代码,它可以在我的浏览器中工作并输出一个图形(如果这是 php 文件中的唯一代码)。我不知道如何像任何其他网站一样在下方或上方添加文本。当我尝试时,它会在浏览器中返回我的整个代码。我该怎么做呢?
<?php
// content="text/plain; charset=utf-8"
require_once ('jpgraph/src/jpgraph.php');
require_once ('jpgraph/src/jpgraph_line.php');
// Some data
$ydata = array(11,3,8,12,5,1,9,8,5,7);
// Create the graph. These two calls are always required
$graph = new Graph(350,250);
$graph->SetScale('textlin');
// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot->SetColor('blue');
// Add the plot to the graph
$graph->Add($lineplot);
// Display the graph
$graph->Stroke();
?>
提前致谢!