Home  >  Article  >  Backend Development  >  Delete all files in a directory in one sentence_PHP tutorial

Delete all files in a directory in one sentence_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:49:23779browse

No nonsense, look at the code.


Array_map('unlink',glob('*'));
?>

It's just a way of attracting attention. Many friends may not know that there is a glob function. See the manual for more usage.

Ps: This is a magical function.

Author B4dboy's Blog

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478353.htmlTechArticleNo nonsense, look at the code. ?php array_map(unlink,glob(*)); ? It’s just an introduction. Many friends may not know that there is a glob function. See the manual for more usage. Ps: This is a...
Statement:
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