Home > Backend Development > PHP Tutorial > PHP中判断索引是否为空的函数

PHP中判断索引是否为空的函数

WBOY
Release: 2016-06-13 10:40:58
Original
966 people have browsed it

PHP中判断目录是否为空的函数

判断目录是否为空,true为空,false为不空

function is_empty_dir($fp)   {   	$H = @ opendir($fp);	$i=0;   	while($_file=readdir($H)){   		$i++;   	}   	closedir($H);   	if($i>2){		return false;	}else{		return true;  	}}
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template