初学者问个简单的逻辑有关问题,求解答
程序员文章站
2022-06-17 16:54:07
...
菜鸟问个简单的逻辑问题,求解答
我是想实现62进制的功能,可是下面这段代码只能echo出来,不能返回,不知道是什么原因,求高手解答
我是想实现62进制的功能,可是下面这段代码只能echo出来,不能返回,不知道是什么原因,求高手解答
function dwz($id,$str=""){
$a=array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");
$zs=(int)($id/sizeof($a));
$xs=$id%sizeof($a);
if($zs>=sizeof($a)){
$str=$a[$xs].$str;
dwz($zs,$str);
}
else{
if($str==""){
return $a[$zs].$a[$xs];
}
else{
echo $a[$zs].$str;//这里只能输出
return $a[$zs].$str;//返回没值,不知道什么原因
}
}
}
for($i=999990;$i echo dwz($i);
echo "
";
}
逻辑
菜鸟
简单的
专题推荐
-
独孤九贱-php全栈开发教程
全栈 170W+
主讲:Peter-Zhu 轻松幽默、简短易学,非常适合PHP学习入门
-
玉女心经-web前端开发教程
入门 80W+
主讲:灭绝师太 由浅入深、明快简洁,非常适合前端学习入门
-
天龙八部-实战开发教程
实战 120W+
主讲:西门大官人 思路清晰、严谨规范,适合有一定web编程基础学习
- 最新文章
- 热门排行
网友评论
文明上网理性发言,请遵守 新闻评论服务协议
我要评论