Just another random string generator

Basically, I created this random string generator so that it is flexible enough to handle all my needs for random string: initial password for new user, password salt, suffix for an uploaded file, etc.

Key features are:

[list=1]

[*]Definable string length

the function can be called like


echo genRandomString(15)

and it will generate 15-character string. Leave the parameter blank and it will generate 10-character random string

[*]Definable set of characters to be randomized

By default, it uses small and capital letters and numbers to form a random string. You can also use a different set of characters (like Russian or Chinese characters) or use only numbers if you want.

[*]Added: Option not to duplicate characters already used

[/list]

Here is the attachment: 1670

common.php

Detailed explanation here: Random String Generator

Just feel like sharing it :)

This should be added to Yii as an helper

@admin: what do you think about ?

Hi i am new in yii framework that’s way i ask to you Mr.Macinville Pls explain step by step how to use one application in the common.php file

[b]

[/b]