Home > Backend Development > PHP Tutorial > Short generated random password supports special characters

Short generated random password supports special characters

巴扎黑
Release: 2016-11-23 15:28:07
Original
1227 people have browsed it

function rand_word($num=12){

$re='';

$list="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~0123456789#$%^&";

$list=str_split($list);

$key=array_rand($list,$num);

foreach($key as $value){

$re .= $list[$value];

}

return $re;

}


Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template