为了账号安全,请及时绑定邮箱和手机立即绑定
不看后悔系列,技术大牛都是乐于分享和提携后辈的,这也是能成为技术大牛的潜质体现。

最新回答 / lighting5
value后用单引号value='<?php echo $code;?>'
function yam($length){
$a=&quot;1234567890&quot;;
$b=&quot;qwertyuiopasdfghjklzxcvbnm&quot;;
$c=&quot;QWERTYUIOPASDFGHJKLZXCVBNM&quot;;
$d=$a.$b.$c;
for ($e=0;$e&lt;$length;$e++){
//echo $d{mt_rand(1, strlen($d)-1)};
$f{$e}=$d{mt_rand(1, strlen($d)-1)};
}
return $f;
}
//yam(4);
$g=yam(4);
foreach ($g as $key=&gt;$x){
echo $x;
}
mt_rand与Rand区别,mt_rand执行速度比rand快4倍
棒棒棒棒棒棒哒
讲得很细致,很耐心,点赞king老师!!!
this is king&#039;s show time ,beginning your show~
老师的声音好有磁性啊
function getCode($length = 4) {
$varcode = &quot;0123456789qwertyuiopasdfgjklzxcbnmvQWERTYUIOPASDLKFJHGZBXNCMV&quot;;

$relult = &quot;&quot;;
for ($i = 0; $i &lt; $length; $i++) {
$relult{$i} = $varcode{mt_rand(0,strlen($varcode))};
}
return $relult;
}

echo getCode();
讲得很好,King老师,顶一个。
$str2{1} = &#039;&#039; 输出 报错 Warning: Cannot assign an empty string to a string offset in E:\www\myself\string\index2.php on line 35
这门课程完结了吗?
能不能发一下源代码
学完啦,并实战了一次,欢迎参观!
http://fatxin.cn/?p=290
课程须知
对php的基础知识掌握,如变量、常量、流程控制等。
老师告诉你能学到什么?
1、字符串的基本使用 2、常用字符串函数库的使用

微信扫码,参与3人拼团

意见反馈 帮助中心 APP下载
官方微信
友情提示:

您好,此课程属于迁移课程,您已购买该课程,无需重复购买,感谢您对慕课网的支持!

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消