How to convert and display string as image

Some times, we need to protect few words or whole string by converting and displaying them as image. for example, in order to avoid scanning your web contents and extracting email addresses (for marketing or any other use) by other people / programmers, you need to protect the email addresses. the easiest way is to convert it into image format.

The simple php trick is to use GD library functions.
Here, i am going to create a function that will input string and returns the converted image back.

as a precaution, we will change page Content-type in header as given bellow:

and finally call the function by passing the text as string

you can use this simple logic to accomplish your complex tasks.

you can download the full working code for How to convert and display string as image.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.