Home  >  Article  >  Backend Development  >  为何循环不出来这个数呢

为何循环不出来这个数呢

WBOY
WBOYOriginal
2016-06-13 12:15:41754browse

为啥循环不出来这个数呢

本帖最后由 shopnc_years2016 于 2015-02-27 21:06:39 编辑 $no=0;
            while($bqrf=$empire->fetch($cx)) {
            if($no%1==0){
                $num=1;
             }elseif($no%2==0){
                $num=2;
             }elseif($no%3==0){
                $num=3;
             }
           $no++;
           echo $no;//有值,能循环出来1,2,3,4...................
           echo $num;输出的全是1
上面的$num不能按要求输出,不知为啥
------解决思路----------------------
因为全进入 if($no%1==0){ } 这个if了。
------解决思路----------------------
 数学啊数学
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn