我很好奇就while和foreach要选择哪个才是对的呢?我相信官方出了选择,应该是有用意?$storeList=$do->query("SELECT*FROM`store`");if(sizeof($storeList)!=0){foreach($storeListas$row){//do...}}$storeList=$do->query("SELECT*FROM`store`");if(mysqli_num_rows($storeList)!=0){while($row=mysqli_fetch_array($storeList)){//do...}}这两个的差别会是在哪里?哪个效率好?且用途更多?
慕运维8079593
相关分类