All,
I am executing a PHP script through CURL which returns a PNG file as an output. How can I show the png file in a php web page?
All,
I am executing a PHP script through CURL which returns a PNG file as an output. How can I show the png file in a php web page?
First of all, why do you need to fetch a PNG through CURL? There's better ways to get a image from server, for example using the <img />
tag..
Anyways, I assume you are getting the binary data in a variable, you can output the image by setting appropriate headers and echoing the data:
header('Content-type: image/png');
echo $image;