Description
This function saves a string's contents to a file.
Warning:
cPanel API 1 is deprecated. Do not use this function. Instead, we strongly recommend that you use the following newer functions:
- UAPI (recommended) —
Fileman::save_file_content
— This function saves a file in a directory and encodes it in a character set. - cPanel API 2 —
Fileman::savefile
— This function saves a string to a file.
Examples
Parameters
Parameter |
Type |
Description |
Possible values |
Example |
dir |
string |
Required The file's directory. |
Any valid directory, relative to the account's /home directory. |
user |
file |
string |
Required The file to modify. |
Any valid filename. |
myfile.txt |
page |
string |
Required The new string to save. |
Any string. |
This is the new string. |
doubledecode |
Boolean |
Required Whether to decode the URL values in the specified directory and file. |
|
0 |
stripnewline |
Boolean |
Required Whether to strip new lines in the file. |
|
1 |
Returns
This function does not return output.