Category Archives: PHP Script

Text to Image converter php script Protect Email ID

Hi there, I did this project 1 year back and the first article about this script was in bangle. Today I will write that into English.  I prepared that script as I have a site where I need to share email ID. But text email id is very attractive element for the email marketer! They just search @ sign and grab email ids! That’s why I thought I need email id as an image.

Anyway, let’s began. What I am gonna say is about a php script that will convert text into image and you may use it to print email on your site same like me. Well, Demo and Download link of the script is as follows

Text to Image php Script Demo and Download Page

Now we will see the codes step by step. First create a new php file on your server give the name image.php, you are free to chose other name also. It’s totally up to you. And on that new file, copy the following code


header ("Content-type: image/png");
$string = $_GET['img'];                                            
$font   = 4;
$width  = ImageFontWidth($font) * strlen($string);
$height = ImageFontHeight($font)+2;
$im = @imagecreate ($width,$height);
$background_color = imagecolorallocate ($im, 255, 255, 255); //white background
$text_color = imagecolorallocate ($im, 0, 0,0);//black text
imagestring ($im, $font, 0, 0,  $string, $text_color);
imagepng ($im);

The above line of code will get text in get method and convert in into Image. And now open another  file (may be index.php or txt2img.php ) and put the below code. Continue reading Text to Image converter php script Protect Email ID

Convert Date English to Bangla Date Converter – PHP code

Hi everyone. Now I am working on a project that is with some calendes. And there we add a function what convert English date into Bangla. It’s pretty simple php code to convert the date. Hope you will enjoy the English to Bangla Date Converter php function. The date format is > Day, Month Date, Year.

And the code is as follows

$currentDate = date("l, F j, Y");
$engDATE = array(1,2,3,4,5,6,7,8,9,0,January,February,March,April,May,June,July,August,September,October,November,December,Saturday,Sunday,Monday,Tuesday,Wednesday,Thursday,Friday);
$bangDATE = array('১','২','৩','৪','৫','৬','৭','৮','৯','০','জানুয়ারী','ফেব্রুয়ারী','মার্চ','এপ্রিল','মে','জুন','জুলাই','আগস্ট','সেপ্টেম্বর','অক্টোবর','নভেম্বর','ডিসেম্বর','শনিবার','রবিবার','সোমবার','মঙ্গলবার','
$convertedDATE = str_replace($engDATE, $bangDATE, $currentDate);
echo "$convertedDATE";

Enjoy …

Add all IP Address to MySQL Database – PHP Script

Internet Protocol is known as IP and one day all device will be controlled  with IP address. I tried to add all IPV4 IP address into MySQL database with php script and yes, I  did it. But, it takes a lot of space! I added IP address to MySQL database from to and it takes 300MB + space! Anyway if you need to print all IP address or y0u wish to add them into MySQL database, follow the following  simple php script.

Well, First, We will see how to print ip address

echo "IP address <br>";

for ($l = 1; $l <= 255; $l++) {
  for ($k = 0; $k <= 255; $k++) {
	  for ($j = 0; $j <= 255; $j++) {
   		 for ($i = 0; $i <= 255; $i++) {
                  echo "$l.$k.$j.$i <br>";
echo "Total IP $count";

We use 4 loop to print ip address. Continue reading Add all IP Address to MySQL Database – PHP Script

Split domain name into sld and tld – php script

A series of alphanumeric strings that are separated by periods, such as, that is an address of a computer network connection and that identifies the owner of the address.

Also, Domain names are used to identify one or more IP addresses. For example, the domain name represents about a dozen IP addresses. Domain names are used in URLs to identify particular Web pages. For example, in the URL, the domain name is

What is SLD

SLD (Second-Level Domain): A second-level domain (SLD) is the portion of a URL (Uniform Resource Locator)  that identifies the specific and unique administrative owner associated with an IP address (Internet Protocol address). The second-level domain name includes the top-level domain (top-level domain) name. For example, in:

hotmobiapp” is a second-level domain. “” is a second-level domain name (and includes the top-level domain name of “com”). Second-level domains can be divided into further domain levels. These subdomains sometimes represent different computer servers within different departments.

What is TLD

TLD (Top Level Domain): A top-level domain (TLD) is one of the domains at the highest level in the hierarchical Domain Name System of the Internet.  The top-level domain names are installed in the root zone of the name space. For all domains in lower levels, it is the last part of the domain name, that is, the last label of a fully qualified domain name. For example, in the domain name, the top-level domain is .com

Well, then what was index.html? or some time /someting/blog.php ? Well, after a domain name, others are either file name or directory name.

Well, Now we know about Domain Name, SLD and TLD. And now, we will see how to split a domain name into SLD and TLD Continue reading Split domain name into sld and tld – php script