Created
July 17, 2019 21:32
-
-
Save parzibyte/517a30055f6b703e7e4b13e8582ce1bd to your computer and use it in GitHub Desktop.
Ejemplo de fwrite en PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// https://parzibyte.me/blog/ | |
$nombreArchivo = "nombres.txt"; | |
$archivo = fopen($nombreArchivo, "w"); | |
$nombres = array( | |
"Luis", | |
"María José", | |
"Maggie", | |
"Panqué", | |
"Julio Verne", | |
); | |
foreach ($nombres as $nombre) { | |
fwrite($archivo, $nombre . PHP_EOL); | |
} | |
fclose($archivo); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment