背景: 我们正在使用 Google Charts 为我们的网络应用程序生成的一些数据创建图表。用户创建报告,然后通过电子邮件发送该报告。问题是,一旦用户在 Microsoft Word 中打开报告,该程序就会表现出一些关于动态生成图像的奇怪行为。
因此,我们希望使用 PHP 将动态生成的图表保存在服务器上,因为 Word 可以毫无问题地处理简单的链接图像。
我对如何进行有点不知所措。想法?
最佳答案
<?
$imageData = file_get_contents('http://chart.apis.google.com/chart... etc');
// Attach image data as attachment to an email
//OR:
file_put_contents('/path/to/save/image.png',$imageData);
?>
关于php - 如何将 Google Charts 保存到服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3738839/