XMPP JavaScript Library

Creating dynamic string image in PHP

PHP, Sachin Puri, 2010-04-25 22:02:39

To create dynamic images in PHP we make use of GD Library. GD Library contains many functions to create and manipulate images.


For this to work make sure that you compile your PHP with GD Library. If you are using PHP on windows system then follow these steps.


1.    Open php.ini file and search for "extension=php_gd2.dll"
2.    Uncomment it by removing semicolon (;) from beginning of line.
3.    Save it and close it.
4.    Open ext (extension) directory it should be in folder where you installed PHP.
5.    Make sure a file named “php_gd2.dll” exists; otherwise download it from PHP site.
6.    Now restart you web server (IIS, Apache etc.)
7.    Create a file named string.php and copy paste code given below:


Now run this script in web browser, you will see:

One gray rectangles = Canvas of Image
One String=  String drawing created by user.


If you have any doubt please post comment I will surely reply you
Have Fun!!!

Code:

Warning: highlight_file(/codes/string.php): failed to open stream: No such file or directory in /home2/sachinpu/public_html/comp/article/article.php on line 24

Warning: highlight_file(): Failed opening '/codes/string.php' for highlighting in /home2/sachinpu/public_html/comp/article/article.php on line 24
Note: If you want to include this image in your web page then write this code in you web page <img src="string.php"/>
Add Your Comment
   
    Yes! I want to receive all comments by email

No Comments Posted Yet. Be the first one to post comment