public function password($length)
    {
        $chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789';
        $str = '';
        for ($i = 0; $i < $length; ++$i) {
            $str .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
        }

        return $str;
    }
public function password($length)
    {
        $chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789';
        $str = '';
        for ($i = 0; $i < $length; ++$i) {
            $str .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
        }

        return $str;
    }
public function password ( $ length ) { $ chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789' ; $ str = '' ; for ( $ i = 0 ; $ i < $ length ; ++ $ i ) { $ str .= substr ( $ chars , mt_rand ( 0 , strlen ( $ chars ) - 1 ) , 1 ) ; } return $ str ; }
Generates random password

@param int $length
@return string
Generates random password