gundambison

log not included

Nov 17th, 2015
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. <?php
  2. /*
  3. masalah log nanti saja..yg ptg jalan
  4. */
  5. $dirSource   =".";
  6. $files =scandir($dirSource);
  7.  
  8. $info =array();
  9.  
  10. foreach($files as $file){
  11.     $target=$dirSource."/".$file;
  12.     if(is_file($target)){
  13.         echo "<br/>{$target} = file";
  14.         $aList[]=array(
  15.             'target'=>$target,
  16.             'name'=>$file
  17.         );
  18.     }else{
  19.         echo "<br>{$target} = not file";
  20.     }
  21.    
  22. }
  23.  
  24. echo "<hr/>";
  25. $aDir=array("../log1","../log2");
  26.  
  27. foreach($aList as $files){
  28.     foreach($aDir as $dir){
  29.         copy($files['target'], $dir."/".$files['name']);
  30.         echo '<br/>copy :'.$files['name']." menuju {$dir}";
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment