note 36381 added to function.copy

From: Date: Wed, 08 Oct 2003 09:21:02 +0000
Subject: note 36381 added to function.copy
Groups: php.notes 
Request: Send a blank email to php-notes+get-58029@lists.php.net to get a copy of this message
$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; } ---- Manual Page -- http://www.php.net/manual/en/function.copy.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+36381 Delete -- http://master.php.net/manage/user-notes.php?action=delete+36381&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+36381&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#58029) next »