Webmaster often needs to generate random password for new users. There are many way to do this but I found a very simple method which can generate strong password of any length. This method is based on str_shuffle() function which randomly shuffles a string. Continue reading
This is a simple php script to extract email address from webpage. This will extract all unique emails and output each in new line. You can modify this script as per your need. Continue reading
To get backlinks and indexed page count from Google most webmasters use scrapping Google search page. It is not a good idea because it fails some time and very slow.
So we can use Google Ajax search API instead of scrapping whole page. It will return data in JSON object which is much smaller then html page.
Although Ajax search API is rate limited to 100 queries per IP per Day but still it’s a good way. Continue reading
By default most of the file types (eg: txt, jpg, png, gif, html, pdf, etc.) displayed in browser instead of download. But we can force browser to download these files instead of showing them. In this article I will explain how to force file download in php. Continue reading
Conversion of geo-coordinates into address is known as Reverse Geocoding. In this script we are using Google map API because it’s free, fast and no API key required.
Rate Limit of Google reveres Geocoding is 2500 API calls per IP per day. Continue reading
This php function helps to determine whether page is accessed by spider bot or not. If page is accessed by any of the bot listed in $bots_list array then function will return bot name otherwise it will return false. I have added only top 3 spider bots in list but you can expend it. Continue reading
This is a standalone php class to find whois information of domain or IP.
- Automatically lookup for secondary whois server.
- In-built IP and domain validator.
- Automatically remove http:// and www. from start of domain
- No dependencies
I have created a tool to check social popularity of website. That shows total number of Google plus, Tweets, Facebook likes, Stumbleupon views, Delicious bookmarks, Linkedin shares and Pinterest pins for a website or URL.
Here is a php class to get social share count. It might be useful for you Continue reading
If you are building a website about movies and want to access movie information from Imdb then you can get it only by web scrapping because Imdb doesn’t provide any API to access its movie database. But there are some third-party API which provides information from Imdb.
In this article I will explain how to use following two APIs
- omdbapi.com (Requires API key)
- imdbapi.org (stopped working)
I was developing a tool which extracts all links from webpage but I was getting relative path (e.g. /dir/page.html) instead of absolute url (e.g. http://www.example.com/dir/page.html). Most of websites use relative path to link internal page and browser can convert in into absolute url but php don’t have any inbuilt function to do this. So after searching internet I found one which can convert relative path into absolute url. This is one of the important function for php programmer but missing in php language Continue reading