PHP Magic Book – Free PHP Scripts, Tutorials and Downloads, PHP AtoZ Reloaded, free php tutorials, free php downloads, php scripts, PHP tips

Archive for August, 2008

Show A Part Of String – substr in PHP

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…)

Tags: , ,
Posted in: PHP Basics, PHP Functions, substr
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment

Auto Populate Years Range In PHP

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…)

Tags: , ,
Posted in: Form, Useful Scripts
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment

Date Difference In PHP – Find Date Difference

We can find out the difference between two given dates in PHP very easily. Consider the following PHP script:

(more…)

Tags: , ,
Posted in: Checks, Date & Time, Useful Scripts
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment

Text To Image Using PHP

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…)

Tags: ,
Posted in: Image Handling, Security, Spam Control, Useful Scripts
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment

PHP Based MP3 Music Directory

PHP Music Directory

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…)

Tags: , ,
Posted in: Directory, Useful Scripts
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment



  Subscribe Via RSS
  Subscribe Via Email