PHP Directory functions

PHP Directory Functions

We all know what is directory in computer system. we can also known as folder in commuter system.
Here, in this php tutorial we will learn how to create directory, delete directory and read files in directory using php functions.

PHP Directory Functions :

  • mkdir() – used to create new directory.
  • rmdir() – used to remove directory.
  • opendir() – used to open directory.
  • readdir() – used to read file of opened directory.

PHP  mkdir() syntax  : View Example

<?php

mkdir(“directory_name”);

?>


PHP rmdir() syntax : View Example

<?php

rmdir(“directory_name”);

?>


PHP opendir() syntax : View Example

<?php

$dir = opendir(“directory_name”);

?>


PHP readdir() syntax : View Example

<?php

$file=readdir(“directory_name”);

?>

We will learn all PHP directory function with an example in next php tutorial.

Leave a Reply

Your email address will not be published. Required fields are marked *

9 + 2 =


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">