Skip to content

Instantly share code, notes, and snippets.

@zhangguiqiang
Created June 2, 2012 16:52
Show Gist options
  • Save zhangguiqiang/2859137 to your computer and use it in GitHub Desktop.
Save zhangguiqiang/2859137 to your computer and use it in GitHub Desktop.
PHP:make_crand_chinese(生成指定长度的中文字符)
function make_crand_chinese($length="5") {
$string = '';
for($i=0;$i<$length;$i++) {
$string .= chr(rand(0xB0,0xF7)).chr(rand(0xA1,0xFE));
}
return $string;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment