How to use Directory scandir in PHP

In this article I am going to explain about scandir function in PHP.
  • 2200

PHP scandir() function

The directory scandir function is used to returns list of files and directories inside a specified path.

Syntax of sacndir function

scandir(directory, sort, context)

Parameters in scandir function

It has only one parameter:

Parameter Description
directory It specifies the directory.
sort It specifies the sort order.
context It is used for description of context parameter.

Example of directory scandir  function

<html>

<body>

<?php

print_r(scandir("C:\wamp\www\Dinesh"));

?>

</body>

</html>


Output:

scandir function.jpg

You may also want to read these related articles :
here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.