search
HomePHP LibrariesOther librariesPHP's multifunctional file operation class
PHP's multifunctional file operation class
<?php
class fileoperate
{
var $path;
var $name;
var $result;
  function creat_file($path,$name)
{
  $filename=$path.$name;
  if (file_exists($filename))
  {
    echo "文件已经存在,请换个文件名";
  }
  else
  {
    if (file_exists($path))
    {
      touch($name);
      rename($name,$filename);
      echo "文件建立成功 </br>";
    }
    else{
      echo "目录不存在,请检查";
    }
  }
}

Create the specified file under the specified path

* @param string $path (needs to include the file name and suffix)

* @param boolean $over_write Whether to overwrite the file

* @param int $time Set time. The default is the current system time

* @param int $atime Set the access time. The default is the current system time


Disclaimer

All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn

Related Article

PHP operation file classPHP operation file class

25Jul2016

PHP operation file class

Java file operation tool classJava file operation tool class

10Nov2016

Java file operation tool class

Complete example code sharing of file operation encapsulation class implemented in C#Complete example code sharing of file operation encapsulation class implemented in C#

16Mar2017

This article mainly introduces the file operation encapsulation class implemented in C#, and analyzes the implementation techniques related to deletion, movement, copying, renaming and other operations of C# encapsulated files in the form of complete examples. Friends in need can refer to the following

PHP image file operation encapsulation classPHP image file operation encapsulation class

07Jun2018

This article mainly introduces the PHP image file operation encapsulation class. Interested friends can refer to it. I hope it will be helpful to everyone.

Real ZIP file operation class phpReal ZIP file operation class php

29Jul2016

: Real ZIP file operation class php:

PHP's FTP operation class (copy, move, delete files, create directories)PHP's FTP operation class (copy, move, delete files, create directories)

25Jul2016

PHP's FTP operation class (copy, move, delete files, create directories)

See all articles