National basic medical insurance and industrial injury Insurance list PHP Directory management functions Summary

Source: Internet
Author: User
ChDir: Change directory.
Dir: Catalog Category class.
Closedir: Close directory handle.
Opendir: Open Directory handle.
Readdir: Read directory handle.
Rewinddir: Resets the directory handle.
ChDir
Change the directory.
Syntax: int chdir (string directory);
return value: Integer
Function Type: File access
This function is used to change the current PHP execution directory into a new directory directory. Returns False if it cannot be changed, or true if successful.
Dir
Catalog Category class.
Syntax: New dir (string directory);
Return value: Class
Function Type: File access
Description This is a similar object-oriented category class that is used to read directories. When directory parameters directory is open, there are two properties available: The Handle property is like the Readdir (), Rewinddir (), and Closedir () used by other non-class functions, and the Path property configures the paths parameter after opening the directory. This class has three methods: Read, rewind, and close.
Usage examples
$d = Dir ("/etc");
echo "Handle:". $d->handle. "
\ n ";
echo "Path:" $d->path. "
\ n ";
while ($entry = $d->read ()) {
echo $entry. "
\ n ";
}
$d->close ();
?>
Closedir
Close the directory handle.
Syntax: void closedir (int dir_handle);
return value: None
Function Type: File access
Content Description
This function is used to close the dir_handle of the directory data stream. The directory to which this dir_handle parameter operates must be Opendir () open for use.
Opendir
Open Directory handle.
Syntax: int opendir (string path);
return value: Integer
Function Type: File access
Content Description
This function is used to open the directory data stream. The returned integer is a handle that can be manipulated by other directory functions.
Readdir
Read directory handle.
Syntax: string readdir (int dir_handle);
return value: String
Function Type: File access
Content Description This function is used to read the directory. Returns the name of the file in the directory, read without any special order.
Use this example to list all files in the current directory
$handle =opendir ('. ');
echo "catalogue handle: $handle \ n";
echo "file: \ n";
while ($file = Readdir ($handle)) {
echo "$file \ n";
}
Closedir ($handle);
?>
Rewinddir
Resets the directory handle.
Syntax: void rewinddir (int dir_handle);
return value: None
Function Type: File access
Description This function is used to reset the directory data stream to the beginning.

The above describes the national basic medical insurance and industrial injury Insurance Drugs catalog PHP Directory management function Summary, including the National basic medical insurance and industrial injury Insurance drugs catalogue content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.