This file contains hidden or 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 | |
| $archivo = fopen('archivo1.txt', 'a'); | |
| fwrite($archivo, "Nueva linea escrita sin borrar el contenido anterior" . PHP_EOL ); | |
| fwrite($archivo, "Última linea" . PHP_EOL ); | |
| fclose($archivo); |
This file contains hidden or 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 | |
| $archivo = fopen('archivo1.txt', 'r+'); | |
| fwrite($archivo, "Hola mundo" . PHP_EOL ); | |
| fwrite($archivo, "Segunda linea" . PHP_EOL); | |
| fwrite($archivo, "Tercera linea" . PHP_EOL); |
This file contains hidden or 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 | |
| $ruta_archivo = 'archivo.txt'; | |
| $archivo = fopen($ruta_archivo, 'r'); | |
| while(!feof($archivo)) { | |
| echo fread($archivo, filesize($ruta_archivo)); | |
| } | |
| fclose($archivo); |
This file contains hidden or 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 | |
| $archivo = file('archivo.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); | |
| echo('<pre>'); | |
| var_dump($archivo); | |
| echo "</pre>"; | |
| ?> |
This file contains hidden or 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 | |
| $archivo = file('archivo.txt'); | |
| echo('<pre>'); | |
| var_dump($archivo); | |
| echo "</pre>"; | |
| ?> |
This file contains hidden or 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 | |
| $archivo = file_get_contents('archivo.txt'); | |
| echo $archivo; | |
| ?> |
This file contains hidden or 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 | |
| $ruta_archivo = 'archivo.txt'; | |
| $archivo = fopen($ruta_archivo, 'r'); | |
| while(!feof($archivo)) { | |
| echo fgets($archivo). "<br />"; | |
| } | |
| fclose($archivo); |
This file contains hidden or 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 | |
| $numero_en_hexadecimal = chr(0x33); // 3 | |
| $numero_en_octal = chr(065); // 5 | |
| $signo_suma = chr(43); // + | |
| $signo_igual = chr(61); // = | |
| $resultado = $numero_en_hexadecimal + $numero_en_octal; | |
| echo $numero_en_hexadecimal . $signo_suma . $numero_en_octal . $signo_igual . $resultado; |
This file contains hidden or 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
| Esta caden|a la vamos| a dividir| en fracio|nes mas pe|queñas, p|ara ser ex|acto cada |10 caracte|res insert|aremos un |salto de l|inea, es i|mportante |recordar q|ue los esp|acios en b|lanco tamb|ien son co|nsiderados| |
This file contains hidden or 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 | |
| $cadena = "Esta cadena la vamos a dividir en fraciones mas pequeñas, para ser exacto cada 10 caracteres insertaremos un salto de linea, es importante recordar que los espacios en blanco tambien son considerados"; | |
| $nueva_cadena = chunk_split($cadena, 10, "|" ); | |
| echo $nueva_cadena; | |
| ?> |