I want to replace all emails in a string with an image of the email.
I already have a PHP function to create an image of the text supplied to it. So I am just looking for how to replace the emails with the corresponding basse64engoded string.
Here is what I want exactly:
"my email is example@example.com and my phone no is 349080353"
I want a function to convert the above string into following:
my email is <img src="image.php?id=ZG5zLWFkbWluQ437yifhb2dsZS5jb20="> and my phone no is 349080353
The id of the email is encoded with base64_encode
. So, I want a function to search and replace email with the following img tag and encode each email with base64_encode
and supply it to 'id'.