Created
June 2, 2012 16:52
-
-
Save zhangguiqiang/2859137 to your computer and use it in GitHub Desktop.
PHP:make_crand_chinese(生成指定长度的中文字符)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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