Skip to content

Instantly share code, notes, and snippets.

@fantasyczl
fantasyczl / generate_password.php
Last active October 15, 2019 11:05
生成随机密码
<?php
/**
* Generate Password
*/
function generate_password($len)
{
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890~!@#$%^&*.?";
$max = strlen($chars) - 1;