Return a loop in function php

后端 未结 7 1212
忘了有多久
忘了有多久 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:57

    No.

    You could, for instance, return an anonymous function which may contain a loop, but you can only return values from functions, not language constructs.

    0 讨论(0)
提交回复
热议问题