编程爱好者之家
php怎么将字符串随机打乱生成新的字符串,编程爱好者之家为大家带来解决办法
$chars ='欢迎访问编程爱好者之家www.codelovers.cn'; $newchars = preg_split('/(?<!^)(?!$)/u', $chars); shuffle($newchars); $newchars = implode("",$newchars); print_r($newchars); //生成结果如下 //c迎w爱dcown欢vel程..r家好o问w访s编e者之