php无限次执行函数,php-PHP一个方法根据传递值怎么执行多次?

php代码function one($type='OfferGetAllOfferList',$start,$pagesize=10,$total=100) { $next=$start+1; if($start*$pagesize<=$total) { $this->outData['next'] = $next; $this->outData['pagesize'] = $pagesize; $this->outData['type'] = $type; $this->outData['total'] = $total; $this->output(); } elseif($type == 'OfferGetAllOfferList' && $start*$pagesize>$total) { $this->outData['next'] = $next; $this->outData['pagesize'] = $pagesize; $this->outData['type'] = 'TradeOrderListGet'; $this->outData['total'] = $total; $this->output(); }elseif($type == 'TradeOrderListGet' && $start*$pagesize>$total) { $this->outData['next'] = $next; $this->outData['pagesize'] = $pagesize; $this->outData['type'] = 'MemberGet'; $this->outData['total'] = $total; $this->output(); }else { echo "同步完成"; exit; } }

js代码

问题:

$type默认是OfferGetAllOfferList,当$start*$pagesize大于100时执行elseif($type == 'OfferGetAllOfferList' && $start*$pagesize>$total)里面的代码,$start归1。

$start*$pagesize大于100时执行elseif($type == 'TradeOrderListGet' && $start*$pagesize>$total)里面的代码,结果归1。

最后输出“同步完成”。

遇到的问题就是第一个if执行完怎么把$start归1继续往底下执行?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值