web 2.0

How to use PHP & Opendir() Open Directory

How to use PHP & Opendir() Open Directory Learn how to use the PHP to List Directory and using Opendir()

ShotDev Focus:
- PHP & List/Open Directory by Opendir()

Example

php_opendir.php


<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<?php
$objOpen = opendir("shotdev");
while (($file = readdir($objOpen)) !== false)
{
echo "filename: " . $file . "<br />";
}
?>
</body>
</html>

Create a php file and save to path root-path/myphp/

Run
http://localhost/myphp/php_opendir.php

Screenshot

PHP List Directory by Opendir()
.
.
.

Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.