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