Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. <?php
  2. $arquivo_origem = "client.php";
  3. $arquivo_destino = "copiado.php";
  4.  
  5. if (copy($arquivo_origem, $arquivo_destino)){
  6. echo "Sucesso!";
  7.  
  8. }
  9.  
  10.  
  11.  
  12.  
  13.  
  14. $handle = fopen( $arquivo_destino, 'a+' );
  15.  
  16.  
  17.  
  18. $file = $arquivo_destino;
  19. $line_looking = 16; //lembre que a contagem começa em 0
  20.  
  21. $lines = file($file, FILE_IGNORE_NEW_LINES);
  22. $lines[$line_looking] = 'Linha substituida';
  23. file_put_contents($file, implode("\n", $lines));
  24.  
  25. // Fecha o arquivo
  26. fclose($handle);
  27.  
  28.  
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement