Home  >  Article  >  Backend Development  >  php简单复制文件的方法_php技巧

php简单复制文件的方法_php技巧

WBOY
WBOYOriginal
2016-05-16 19:52:481181browse

本文实例讲述了php简单复制文件的方法。分享给大家供大家参考,具体如下:

<?php
/**
*author:果冻
*qq:52091199
*wyg517.blog.163.com
**/
$file = 'image/a1.jpg';
$newfile = 'a/123.jpg'; //必须有写入权限
  if (file_exists($file) == false)
  {
   die ('文件不在,无法复制');
  }
  $result = copy($file, $newfile);
  if ($result == false)
  {
   echo '复制成功';
  }
?>

更多关于PHP相关内容感兴趣的读者可查看本站专题:《php文件操作总结》、《PHP运算与运算符用法总结》、《PHP网络编程技巧总结》、《PHP基本语法入门教程》、《php操作office文档技巧总结(包括word,excel,access,ppt)》、《php日期与时间用法总结》、《php面向对象程序设计入门教程》、《php字符串(string)用法总结》、《php+mysql数据库操作入门教程》及《php常见数据库操作技巧汇总

希望本文所述对大家PHP程序设计有所帮助。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn