我有一个第三方php文件,可以生成条形码,名为barcode.php。
当我想要生成一个新的条形码时,我调用这个脚本,如下所示:
<img alt="testing" src="barcode.php?text=455555442233&codetype=Code25" />有没有一种简单的方法可以将生成的图像保存到服务器上,而无需修改barcode.php脚本?
发布于 2016-05-10 11:02:33
$file = 'barcode.jpg'; //file name to write to include location if needed
$current = file_get_contents('http://yoursite.com/barcode.php?text=455555442233&codetype=Code25');//read the created file
file_put_contents($file, $current);//write it在这里使用外部url可能不是最优的,这取决于具体情况。
https://stackoverflow.com/questions/37128504
复制相似问题