Recently I was working with some PHP project and I had to fetch some text from database but I did not want to show all the paragraph. Instead I wanted to display just some part of it and give the reader facility to have a link or read more.
For example:
If the original text is
PHP is a great programming platform where we can do anything relating to dynamic web pages and huge websites.
I wanted to display just a part of it like this.
PHP is a great programming platform…
In this case we use substr which returns a part of string. It means substr returns the portion of string specified by the start and length parameters.
(more…)
In forms its better approach to populate years drop down list rather then writing down every year manually. This script will ask you starting year and rest of years up till latest year it will populate for you.
(more…)
We can find out the difference between two given dates in PHP very easily. Consider the following PHP script:
(more…)
Suppose you want to protect you email address and want to put it online in form of image or you are displaying visitors emails in form of images while they had entered simple text, then this script is very useful. Text used in this example is my-email@hotmail.com under variable text. Find it and replace it or give input by a form and have image version of your entered text.
(more…)

This single file script will display all mp3 music files from directory and display song names and file size while you can play song by a link too. Just place this script in directory containing mp3 music files and browse script by local or online server.
(more…)