Source Rally PHP Community Scripts .. Sign up .. Login
LGPL license
Access: Public      Tags: php, random
Add to favourites       Subscribe comments       Copy code       Bookmark
<?php
function newPass($length=6)
{
    
$password "";
    
$passstring "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
    for(
$i=0$i<$length$i++)
    {
        
$password .= $passstring[rand(0, (strlen($passstring)-1))];
    }
    return 
$password;
}
?>
Add to favourites       Subscribe comments       Copy code       Bookmark
Sign up to add your own comment here!

Comments

neptho - 15-09-2007 00:19
Add to friends       Mail user
This function also works great for homebrew captcha systems. I've got my own which works much the same way, but has several 'look alike' characters removed, 'O, 0, i, 1, etc..'
More comments: 1
Shared by:

regin

Mail user Add to friends
All user contributed content is available under the unless specified otherwise.
Remaining copyrights Regin Gaarsmand 2006-2008
About www.SourceRally.net