I have a question about saving text/strings as images in PHP. Since I want to protect data on my site, I want to convert text and save it as image files in a folder on a server (before displaying it). Is there a way to do it, or maybe a better solution? Thanks in advance
If you wish to convert Text/String into image, you can try ImageMagick or GD.
Detail about ImageMagick (Imagick extension) is available at http://php.net/manual/en/book.imagick.php)
Detail about GD at http://php.net/manual/en/book.image.php
getimagettftext()
function from GD can be useful, see detail at http://php.net/manual/en/function.imagettftext.php
Imagick::annotateImage()
function from Imagick can be useful, see detail at http://php.net/manual/en/function.imagettftext.php
If you want to save text as an image, not overlay it on another image, then you should use label: or caption: or tango: in ImageMagick and not annotate.
See http://www.imagemagick.org/Usage/text/. Then find the equivalent command in Imagick. For example, http://us3.php.net/manual/en/imagick.labelimage.php
You can use the equivalent of -annnotate, but then you have to create an background image onto which to write the text.
The advantage of label: for example is that it creates an image automatically.