【发布时间】:2011-06-27 09:38:13
【问题描述】:
我有三个字符串,我想使用这三个字符串生成一个随机字符串,其中在字符串之间包含一些随机数。
谢谢
Ex: first string : john
second string : smith
third string : john9k
I want a random string like : john.simth190, smith.john9k, john9k.123.smith, etc.,
如何在 PHP 中做到这一点。
谢谢
【问题讨论】:
-
rand()会给你随机数和点 (.) 执行字符串连接,例如echo 'john' . rand(1, 1000) . '.smith';可能会产生john271.smith。