note 36381 deleted from function.copy by aidan
| From: | aidan@php.net | Date: | Mon, 30 Aug 2004 07:03:59 +0000 |
| Subject: | note 36381 deleted from function.copy by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-75643@lists.php.net to get a copy of this message | ||
Note Submitter: www at w8c dot com
----
<?php
$source="test";
$dest="test/php";
//see if (is_dir("$source/$entry")&&$dest!=="$source/$entry")
copys($source,$dest);
function copys($source,$dest)
{
if (!is_dir($source))
return 0;
if (!is_dir($dest))
{
mkdirs($dest);
}
$h=@dir($source);
while (@($entry=$h->read()) !== false)
{
if (($entry!=".")&&($entry!=".."))
{
if (is_dir("$source/$entry")&&$dest!=="$source/$entry")
{
copys("$source/$entry","$dest/$entry");
}
else
{
@copy("$source/$entry","$dest/$entry");
}
}
}
$h->close();
return 1;
}
?>