Friday 19 April 2013

PHP File



Function fopen () in PHP is used to open the file.

File open.
Function fopen () in PHP is used to open the file.

The first parameter is used to open the file and gave the second parameter is used to limit the files that have been opened.

EXAMPLE:

<?php
$file = fopen('welcome.tx', 'r');
?>
Modes Penjelasan
r Read only.
r+ Read/Write.
w Write only. if the file does not exist in the open it will in create a new file
w+ Read/Write.
a Append.
a+ Read/Append.
x Write only.
x+ Read/Write.


Close the file.
Function fclose () allows you to close the file in the sense that the file can not be closed in access by web visitors.

EXAMPLE:
<? php
$ file = fopen ('welcome.tx', 'r');
fclose ($ file);
?>

No comments:

Post a Comment