Return a loop in function php

后端 未结 7 1281
忘了有多久
忘了有多久 2021-01-13 14:04

Is it possible to return a loop? not the result but the loop it self. I want to create a function in php. For example like this.

function myloop($sql){
$quer         


        
7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-13 14:46

    No, it isn't.

    You can return a function to does nothing but run a loop, but you can't return the loop itself.

提交回复
热议问题