16- filing lecture 2 php

Post on 15-Jan-2015

216 Views

Category:

Education

0 Downloads

Preview:

Click to see full reader

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?

top related