Return a loop in function php

后端 未结 7 1210
忘了有多久
忘了有多久 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.

提交回复
热议问题