Check if a variable type is iterable?

后端 未结 6 1021
失恋的感觉
失恋的感觉 2020-11-29 02:16

Is there any way to check if an arbitrary variable type is iterable?

So to check if it has indexed elements or I can actually loop over it\'s children? (Use foreach

6条回答
提交回复
热议问题