donglian1953 2019-07-07 20:16
浏览 237

如何在while循环中保持循环?

I have a table with five rows for example, and my while loop will display the five rows for me as per normal. I‘m trying to get the loop to keep looping records until let's say $count = 12. I want to start the counter at 0 and it will end at 12. So, I pretty much want the loop to keep showing the same records randomly until it shows me 12 or so results and then stops.

  • 写回答

2条回答 默认 最新

  • dongyuan9149 2019-07-07 20:22
    关注

    Simple as while ($a != 12)

    $counter = 0;
    
    while ($counter != 12) {
        // Do stuff
        $counter = rand(0, 24);
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 STM32驱动继电器