Posted by vkrmsv on Fri 19 Sep 17:23
report abuse | download | new post
- <?php
- function convert_text_image($text_input)
- {
- $my_img = imagecreate( 290, 18 );
- $background = imagecolorallocate( $my_img, 255, 255, 255 );
- $text_colour = imagecolorallocate( $my_img, 0, 0, 0 );
- imagestring( $my_img, 4, 0, 0, $text_input,$text_colour );
- imagegif($my_img);
- $img_out = chunk_split(base64_encode($img_out)); // Encodes the data so that we can display this as a raw image on the browser.
- $string = "\"data: image/gif;base64,".$img_out."\"";
- echo "<img src=$string />";
- imagedestroy( $my_img ); //Free resources.
- }
- $text = "example@example.com";
- convert_text_image($text);
- ?>
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.