<?php
/**
* The class is use to generate a random password.
* @author Naveen Valecha<valecha29@gmail.com>
*/
class RandomPassword {
protected $password;
public function password($length) {
$string = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*';
$this->password = substr(str_shuffle($string), 0, $length);
return $this->password;
}
}
?>
|