PHP判断一个变量是否可以通过foreach进行遍历时间:2023-03-09 09:20:31 <?php if( !is_array( $items ) && !$items instanceof Traversable ) //Throw exception here ?>