Determines whether the directory is empty. true is empty. false is null. functionis_empty_dir ($ fp) & amp; nbsp; & amp; nbsp ;{& amp; nbsp; & amp; nbsp; $ H @ opendir ($ fp); $ i0; & amp; nbsp; while ($ _ filereaddir ($ H) {& amp; nbsp; & amp; nbsp; $ I ++; & amp; nbsp ;}& amp; nbsp; & amp; nbsp; close .. // Determine whether the directory is empty. true is empty. false is empty. 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 ;}} 1. description: determines whether the directory is empty. // determines whether the directory is empty. true indicates null. false indicates that the function is_empty_dir ($ fp) {$ H = @ opendir (
1. 10 articles about php closedir () functions are recommended.
Description: The php dirname () function is the directory part of the returned file path. It provides a string containing a full path pointing to a file, and returns the directory name after removing the file name. The usage is very simple. This article collects several articles about the usage of the php dirname () function, hoping to help you understand the php dirname () function.
[Related Q & A recommendations ]:
Python2.7-how can I solve No such file or directory: 'Python '?
How to solve the link element in angular. js-angular direve VE is not a function?
When logging on to shell-ssh, the prompt/bin/bash: No such file or directory is displayed. why?
Javascript-the pdf file on the webpage cannot be displayed and an error is reported. can someone tell me that the font is missing? how can this problem be solved?
Docker running in Ubuntu
The above is a detailed article about the php dir () function. For more information, see other related articles in the first PHP community!