From d123d4a0ebe55d5508bdc3ece9fa9b9cde643697 Mon Sep 17 00:00:00 2001
From: RichardLimSpring <38887201+RichardLim00@users.noreply.github.com>
Date: Fri, 29 Mar 2019 06:22:19 +0800
Subject: [PATCH] Add basic PHP file writing functions (#30396)
* Add basic PHP file writing functions
2 different fopen mode, each with different properties and 1 file writing function.
* fix: removed stub info
* Update index.md
* Update index.md
---
.../php/functions/files/file-writing/index.md | 48 +++++++++++++++++--
1 file changed, 45 insertions(+), 3 deletions(-)
diff --git a/guide/english/php/functions/files/file-writing/index.md b/guide/english/php/functions/files/file-writing/index.md
index ec79f94418..53a708c2ec 100644
--- a/guide/english/php/functions/files/file-writing/index.md
+++ b/guide/english/php/functions/files/file-writing/index.md
@@ -3,11 +3,53 @@ title: File Writing
---
## File Writing
-This is a stub. Help our community expand it.
+PHP has prepared a few functions to help user save information outside of PHP to be used later.
-This quick style guide will help ensure your pull request gets accepted.
+## fopen("fileName.txt","w")
+Like most of the file handling functions, before conducting any file operation we must prepare the file for the operation first.
+```PHP
+
+ $fileHandler = fopen("fileName.txt", "w");
+
+?>
+```
+$fileHandler is the file handling variable, the function to write should pass this variable as an argument.
+
+## fwrite()
+This is the function to add content to your file. This function should contain two variables, the first one should be the file handling variable and the second should be the content you wish to add to the file.
+```PHP
+
+```
+```PHP
+
+```
+## fopen("fileName.txt", "a")
+If the file chosen previously contained content, the fwrite function will overwrite the previous content.
+If you wish to add content to the file but didn't want to overwrite the existed content in the file, you should use append mode ("a") for the fopen() function.
+```PHP
+
+```
#### More Information:
+- [fopen Function](http://php.net/manual/en/function.fopen.php)
+- [fwrite Function](http://php.net/manual/en/function.fwrite.php)