List files in a director in PHP?

By Moe Jame Share
Browse the PHP category for more tutorials

First, Open your text editor (i.e. Notepad++)

As soon as Notepad++ opens, directly go to the menu File > Save As..

Type in the filename, for purpose of consistency, we will type in “thinktutorialcom-exercice2.php” and click on Save

Then type in the following PHP code:

Upload your file on your PHP server. Then open Google Chrome

and then type in the full path to the file you uploaded  on your server and press enter and see the result

Exercice 2: List all files in a directory Download the Source PHP file



More PHP Tutorials

How to Display text using a variable on PHP

How to List files in a director on PHP

Follow us on Twitter Subscribe to our Feeds Become a Fan on Facebook

Follow Us


Didn't find your answer?

Post your question on our forum and ask the community!

Ask a question!