Ajax and returning image created by PHP GD
问题 I have a PHP script that generates an image with PHP GD. After it generates the image, it saves it, and send this output when called by Ajax: imagejpeg($img_data, 'filename.jpg'); echo '<img src="/filename.jpg.jpg">'; And after that, the image is shown on the page, and everything is fine. But, I don't want to create an image every time. Is there some way that I return by Ajax only $raw_data string and show the image? I tried like this: echo $img_data; But no luck, only thing that is returned