PHP Directory operation correlation function explanation

Source: Internet
Author: User
Tags create directory glob mkdir

This article is suitable for beginners of the small white PHP directory operation functions related to understanding.


<?php/** Directory-related Operations function we know that article has a.txt b.txt c.txt d.txt We can write, but when the file has e.html F.mp3 .... We simply process TXT file using glob () matching file ****///print_r (glob (' *.txt '));	Glob () is looking for a matching//print_r (Glob ('./article/*.txt ') in the current directory);  OK//glob () is useful at work, but the focus today is not//To view all files in the directory, open the directory with Opendir/* Opendir, return the resource handle, available for subsequent closedir (), Readdir (), and Rewinddir ()
	In the call. Readdir read directory \, success returns a filename or returns FALSE on failure, so I use NULL to mkdir create directory rmdir delete directory Closedir close directory Is_dir to determine if it is a directory Unlin

K Delete file */$path = './misc ';	Var_dump (Opendir ($path));
Resource (3, stream) $dh = Opendir ($path); /* echo Readdir ($DH); 
// . echo Readdir ($DH);
// .. echo Readdir ($DH); A.txt Echo Readdir ($DH); B.exe//. And..

is the virtual directory, the current directory and superior directory, * * echo " 


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.