Delete all files in a directory in one sentence_PHP tutorial

WBOY
Release: 2016-07-13 17:49:23
Original
744 people have browsed it

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...
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!