I want to create several images with PHP on my webpage. Is there a way to do this without creating each image in its own PHP file and then placing the URLs to these files in img tags?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I suggest you take the image and encode it to BASE64 using base64_encode(), this way you can insert the image data directly into the HTML markup (safer than injecting binary).
The process is described at this site. But in a nutshell just have a tag that looks like the following (everything after the “base64,” is the encoded data):