Codex

WPMU Functions/generate random password

Contents

Description

Generates a random password of the specified length (up to a maximum of 32 characters).

Parameters

$len
(integer) (Optional) The length of the password to generate. Values over 32 will return a 32 character password.
Default: 8

Return values

(string) 
A random password of length $len.

Usage

<?php generate_random_password($len?>

Examples

<?php
  
echo 'Random password: '.generate_random_password( );
?>

Notes

This function executes the random_password filter after generating the password.