Ver Mensaje Individual
  #2 (permalink)  
Antiguo 29/07/2010, 06:04
Avatar de Chenon
Chenon
 
Fecha de Ingreso: abril-2005
Ubicación: Palma de Mallorca
Mensajes: 99
Antigüedad: 19 años, 1 mes
Puntos: 11
Respuesta: crear array de txt

Es muy fácil.

Código PHP:
Ver original
  1. <?php
  2. $tal = array();
  3. $file = fopen("welcome.txt", "r") or exit("Unable to open file!");
  4. //Output a line of the file until the end is reached
  5. while(!feof($file)) {
  6.   array_push($tal,fgets($file));
  7. }
  8. fclose($file);
  9.  
  10. print_r($tal);
  11. ?>

Sacado de: http://www.w3schools.com/PHP/php_file.asp

Lo que haces simplemente es abrir un archivo, y lo recorres linea por linea, añadiendo cada una de esas lineas a un array existente.

No he probado si funciona, pero creo haberlo probado antes y me fue bien.