Code has been added to clipboard!

The Complete Guide on PHP Directory: Master Functions

Reading time 2 min
Published Aug 8, 2017
Updated Oct 2, 2019

A PHP directory is a structure used to catalog and keep our files. It's a part of an organizing system that lets us keep track of our projects and code files more easily.

PHP has a bunch of inbuilt functions that let us quickly fetch information about particular PHP files in the directory. Additionally, it is possible to retrieve data about a whole specific PHP directory. We can easily make PHP list files in directory, open specified handles, and perform other tasks.

PHP Directory: Main Tips

  • Directory functions allow you to get info about various PHP directories and what they contain.
  • These functions are inbuilt into the PHP's core.
Udacity
Pros
  • Simplistic design (no unnecessary information)
  • High-quality courses (even the free ones)
  • Variety of features
Main Features
  • Nanodegree programs
  • Suitable for enterprises
  • Paid certificates of completion
Coursera
Pros
  • Professional service
  • Flexible timetables
  • A variety of features to choose from
Main Features
  • Professional certificates of completion
  • University-level courses
  • Multiple Online degree programs
Datacamp
Pros
  • Great user experience
  • Offers quality content
  • Very transparent with their pricing
Main Features
  • Free certificates of completion
  • Focused on data science skills
  • Flexible learning timetable

List of Useful Functions

The following list contains the functions you can apply in order to manipulate every PHP directory you create:

Function Description
chdir() Change current PHP directory
chroot() Change root directory
closedir() Close directory handle
dir() Return instance of directory class
dirname() Make PHP get root directory
getcwd() Return current working PHP directory
opendir() Open specified directory handle
readdir() Return entry from directory handle
rewinddir() Reset directory handle
scandir() Make PHP list files in directoryReturn array of PHP files in directory specified (or directories from multidimensional array)

PHP Directory: Summary

  • Information on any PHP file directory and the files it contains can be obtained using PHP directory functions.
  • These functions are inbuilt, and therefore don't require installation.

Latest Udacity Coupon Found:

Verified STAFF PICK

75% OFF COURSES

Udacity Black Friday Offer

The best time to save on Udacity courses is now - follow this coupon to access a 75% Udacity Black Friday discount & enjoy learning at a very low cost!

Expiration date: 30/01/2021
3176 People Used
Only 97 Left
Rating
5.0