12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php
- namespace app\common\model\base\models;
- class FileServer
- {
-
-
- static public function appendLine(string $filename, string $content='')
- {
- $fp = fopen($filename,'a');
- fwrite($fp,$content);
- fclose($fp);
- }
-
-
- static public function appendAll(string $filename,array $content=[])
- {
- $fp = fopen($filename,'a');
- foreach($content as $item){
- fwrite($fp,$item);
- }
- fclose($fp);
- }
-
-
- static public function writeLine(string $filename,string $content='')
- {
- $fp = fopen($filename,'w');
- fwrite($fp,$content);
- fclose($fp);
- }
-
-
- static public function writeAll(string $filename,array $content=[])
- {
- $fp = fopen($filename,'w');
- foreach($content as $item){
- fwrite($fp,$item);
- }
- fclose($fp);
- }
- }
|