判断数组是否为空,几种方法的效率比较:
Total Elapsed Time User+System Time
if($a[0]) 1 1
if(exists($a[0])) 1.23 1.22
if($#a) 2.03 2.02
if(@a) 2.10 2.09
没有评论:
发表评论