Home PHP Libraries Other libraries PHP'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 class PHP operation file class

25 Jul 2016

PHP operation file class

Java file operation tool class Java file operation tool class

10 Nov 2016

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#

16 Mar 2017

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 class PHP image file operation encapsulation class

07 Jun 2018

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 php Real ZIP file operation class php

29 Jul 2016

: Real ZIP file operation class php: <? /******************** Author unknown Organized by: Longbill (www.longbill.cn; longbill.cn@gmail. com ) *********************/ class zip { var $datasec, $ctrl_dir = array(); var $eof_ctrl_dir = "x50x4bx05x06

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

25 Jul 2016

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

See all articles