<?php
function randPwd($numAlpha = 31, $numNonAlpha = 1){
$listAlpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$listNonAlpha = ',;:!?.$/*-+&@_+;./*&?$-!,';
echo str_shuffle(
substr(str_shuffle($listAlpha),0,$numAlpha) .
substr(str_shuffle($listNonAlpha),0,$numNonAlpha)
);
}
?>