<?php function generate_password( $length = 16 ) { $chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; $password = ''; for ( $i = 0; $i < $length; $i++ ) { $password .= $chars[ mt_rand(0, strlen($chars) - 1) ]; } return $password; }
echo generate_password(16); ?>
|