Fungsi unlink() digunakan untuk menghapus file secara permanen. Nilai balik fungsi ini adalah TRUE jika proses hapus suskes dilakukan, dan FALSE jika prose penghapusan file gagal dilaksanakan.
Sintaksnya adalah (string filename)
Argumen string filename menyatakan nama file yang akan dihapus. Contoh aplikasi fungsi unlink() adalah:
<?PHP
$result=unlink(“data5.txt”);
if($result){
echo “File data5.txt telah berhasil dihapus”;
}else{
echo “FIle data5.txt gagal dihapus”;
}
?>
2.Glob
glob — Find pathnames matching
a pattern
Description
array glob ( string
$pattern
[, int $flags
= 0 ]
)
The glob()
function searches for all the pathnames matching
pattern
according to the rules used by the libc glob() function, which is
similar to the rules used by common shells. Parameters
pattern
-
The pattern. No tilde expansion or parameter substitution is done.
flags
-
Valid flags:
GLOB_MARK
- Adds a slash to each directory returnedGLOB_NOSORT
- Return files as they appear in the directory (no sorting). When this flag is not used, the pathnames are sorted alphabeticallyGLOB_NOCHECK
- Return the search pattern if no files matching it were foundGLOB_NOESCAPE
- Backslashes do not quote metacharactersGLOB_BRACE
- Expands {a,b,c} to match 'a', 'b', or 'c'GLOB_ONLYDIR
- Return only directory entries which match the patternGLOB_ERR
- Stop on read errors (like unreadable directories), by default errors are ignored.
0 comments:
Post a Comment