File File(
String
$file, [String
$access = '']
)
|
|
Constructor
Parameters:
|
String |
$file: |
A valid filename to open and read or write |
|
String |
$access: |
Access Modifier- r open a file for reading only
- r+ open file for reading/writing
- w open a file for writing only. Truncate to zero length.
- w+ open the file for reading /writing. Truncated to zero length.
- a open a file for appending data
- a+ open the file for appending and reading data
- b open the file as binary read/write
|
boolean append(
String
$content
)
|
|
Append the content to the file opened by fp
Parameters:
|
String |
$content: |
The content to append |
API Tags:
| Return: | Returns true on success |
Close the file opened by fp
API Tags:
| Return: | Returns true on success |
Reads the content of the specified file as a string
API Tags:
| Return: | Returns the content of the file |
Open the file
API Tags:
| Return: | Returns true on success |
boolean save(
String
$content
)
|
|
Save the content to the file opened by fp
Parameters:
|
String |
$content: |
The content to write |
API Tags:
| Return: | Returns true on success |
boolean write(
String
$line
)
|
|
Write the line to the file opened by fp
Parameters:
|
String |
$line: |
The line to write |
API Tags:
| Return: | Returns true on success |