Administración de Sistemas

Lunes, 11 Enero 2021 15:17

PHP Escribir en un fichero con fwrite()

Written by 
Rate this item
(0 votes)

Ejemplo de script PHP para escribir en un fichero

<?php
$myfile = fopen("nuevo-fichero.txt""w"or die("No se puede abrir el fichero!");
$txt = "John Doe\n";
fwrite($myfile, $txt);
$txt = "Jane Doe\n";
fwrite($myfile, $txt);
fclose($myfile);
?>

Read 2350 times