Create numbered captcha in php

Creating CAPTCHA in php is very simple. I followed lot of tutorials through out the web. I found 100s of code lines in php but every body is following the hard structure which is very difficult in some cases to adopt the code line. Here I am giving a very simple code line where people can implementthis code and return the captcha easyly in jquery as well.

To create the captcha write the following code into an php file like captcha.php