Ejemplo de funciones que trabajan con fichero2

En esta ocasión mostrare un Ejemplo de funciones que trabajan con fichero php v2
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>appletenhtml</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body>
<section>

<?php
//copy  como el nombre lo dice copea x arhcivo
    copy('hola.text','Nombre.txt');
 
    //rename renombrar archivo
    rename('hola,txt','renombrado.txt');
 
    //unlink  elimina fichero
    unlink('ArchivoABorrar.txt');
 
    //Abrir fichero
    $archivo = fopen('ArchivoAAbrir.txt','a+');
 
    //alias de fwrite
     fputs($archivo,"New Text al final");
    //fgets() adquirir lineas del archivo
   while($lectura = fgets($archivo))
{    echo $lectura."<br>"; }
 
 
    //cerrar fichero
    fclose($archivo);
 
?>  
</section>
</body>
</html>
Funcion para administrar basicamente la existencia de x archivo.

Comentarios

Populares

Buscar en este blog