This example describes the simple way to copy a file in PHP. Share to everyone for your reference, specific as follows:
<?php
/**
*author: Jelly
*qq:52091199
*wyg517.blog.163.com
**/
$file = ' image/a1.jpg ';
$newfile = ' a/123.jpg '; Must have Write permission
if (file_exists ($file) = = False)
{
die (' file is not available, cannot replicate ');
}
$result = Copy ($file, $newfile);
if ($result = = False)
{
echo ' copy succeeded ';
}
? >
More interested in PHP related content readers can view the site topics: "PHP file Operation Summary", "PHP operation and operator Usage Summary", "PHP Network Programming Skills Summary", "Basic PHP Grammar Introduction Tutorial", "PHP operation Office Document skills Summary (including Word, Excel,access,ppt), "The PHP date and time usage summary", "PHP object-oriented Programming Introduction Tutorial", "PHP string (String) Usage Summary", "Php+mysql Database operation Introduction Tutorial" and "PHP common database Operation skill Summary"
I hope this article will help you with the PHP program design.