16- filing lecture 2 php
DESCRIPTION
TRANSCRIPT
File Handling
File Pointer Functions
fseek() — Seeks on a file pointer
ftell() — Returns the current position of the file
read/write pointer.
rewind() — Rewind the position of a file pointer.
Working With Directories
getcwd — Gets the current working directory. rmdir — Removes directory. mkdir — Makes directory. chdir — Change directory. rename — Renames a file or directory. unlink — Deletes a file. readdir — Read entry from directory handle. opendir — Open directory handle. pathinfo — Returns information about a file path.
Reading A Directory
<?php $directory=".";
$res=opendir($directory); while($file=readdir($res)){
echo $directory."/".$file
} ?>
Questions?