php - Convert image to string without saving image -


i know there quite lots question on stack overflow don't think question same.

i want convert image resource string without having save image disk.

is there function that, im not aware of , did not got able find in pass hour of searching google.com

you can use of image* functions output image stream , use output buffering capture it:

ob_start(); // example jpeg imagejpeg($resource); $image_string = ob_get_contents(); ob_end_clean(); 

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -