Takes a string and converts it into an image. The script adds line breaks to the string and dynamically adjusts the height depending on the number of lines.
This project contains the text-to-image.php and
- A web demo using the text-to-image.php: text-to-image-demo.php
- Another demo that adjusts color, art, figures in the image: art-generator.php
- An example use--display an email address as an image--under email-example/
Include:
include 'text-to-image.php';
Pass a string through the function:
$string = 'Pass strings like this or from a form using POST';
$image = new image;
$image->makeImageFromString($string);
The result will look something like this:
Can be used to create reCAPTCHA-esque images for spam prevention, generate unique images for users, store display user emails in a photo to prevent spammers from obtaining this information, and so on.
Install by cloning: `git clone [email protected]:harmankang/text-to-image-php.git`I will not put this in the readme, so google "How to run PHP scripts on my computer." It takes less than 5 minutes to set up.
Open in browser and enjoy!