Output as an image using PHP

允我心安 提交于 2021-01-29 17:56:11

问题


I'm creating a comments system for my 'CMS' and would like to implement avatars. I would like to have a "getavatar.php" that uses a GET request to find an image for a certain user, while also doing some image processing.

Could anybody point me in the right direction for outputting data as "image/png" from a php script?

An example of this would be http://placehold.it/300x300 in the way it generates a 300x300 png image from the parameters given in the URL.


回答1:


To output an image using PHP: Output an Image in PHP

To resize or edit an image using PHP: resize image in PHP

Both answers contains a lot of useful functions. Hope this help you.



来源:https://stackoverflow.com/questions/26829208/output-as-an-image-using-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!