Tutorials >> View >> 6
Yahoo chat: marklester_aover
Bookmark and Share

PHP function that would generate Random Characters

This php function will generate random characters. This randomChar() function has a paramters of $limit which is the number of character that you want to return and the $char which you can change the default character type that you want to return.

Learn the codes below:

function randomChar( $limit=5, $char="abcdefghijklmno01234" ){
        for($x = 1; $x <= $limit; $x++){
            $newPass .= substr($char, mt_rand(-1, -(strlen($char))), 1 );
        }
        return $newPass;
    }

Click image to download the Zip file:

# of Comments (1)

by: Joel Azcuna

Hi Mark, keep up the good work! nice site and simple yet helpful tutorials.

2008-06-25

Add your comment here...

Please feel free to make a comment and suggestion on this tutorial. Your comment and suggestion will help improve the tutorial for the benefit of you and others. Thank you...

Name : *
Email Add : *
URL (include http://):
Messages : *
Security Code : *
(*) Must not leave blank.
captcha

Our Main Services

We develop and deliver the following services:

Latest News...

Search My Site

 This Site   Web

Google Ads

Google Ads

Powered By:

Advertise

Place your Custom Advertise here $29 for 1 month. Image dimension 276x180 pixels. Click the Paypal "Buy Now" button below.