初学者问个简单的逻辑有关问题,求解答

WBOY
發布: 2016-06-13 12:43:42
原創
828 人瀏覽過

菜鸟问个简单的逻辑问题,求解答
我是想实现62进制的功能,可是下面这段代码只能echo出来,不能返回,不知道是什么原因,求高手解答

<br />
function dwz($id,$str=""){<br />
	$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");<br />
	$zs=(int)($id/sizeof($a));<br />
	$xs=$id%sizeof($a);<br />
	if($zs>=sizeof($a)){<br />
		$str=$a[$xs].$str;<br />
		dwz($zs,$str);<br />
	}<br />
	else{<br />
		if($str==""){<br />
			return $a[$zs].$a[$xs];<br />
		}<br />
		else{<br />
			echo   $a[$zs].$str;//这里只能输出<br />
			return $a[$zs].$str;//返回没值,不知道什么原因<br />
		}<br />
	}<br />
}<br />
for($i=999990;$i<=1000000;$i++){<br />
	echo dwz($i);<br />
	echo "<br>";<br />
}<br />
登入後複製
逻辑 菜鸟 简单的

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板