Ver Mensaje Individual
  #3 (permalink)  
Antiguo 29/05/2009, 10:01
jjsi
 
Fecha de Ingreso: mayo-2009
Ubicación: San Juan de Alicante
Mensajes: 9
Antigüedad: 15 años, 9 meses
Puntos: 0
De acuerdo Respuesta: Leer partes de un txt

Decías...
Cita:
Iniciado por abimaelrc Ver Mensaje
Código PHP:
$getArray file("texto.txt");

$firstPart false;
foreach(
$getArray as $k => $v){
  
$explodeArray explode(" "$v);
  if(
$explodeArray[0] == "dia"){
    
$firstPart true;
  }
  if(
$firstPart){
    echo 
$v;
  }


Me dejas saber
Muchas gracias por tu codigo, el cual he implementado asi:
Código PHP:
<?php

$fichero 
fopen("texto.txt","r");
    
        while (
$lineafgets($fichero,1024)){
            
$texto explode("-"$linea);
              if(
$texto[0] == "2009"){
                echo 
$linea."<br>";                
              }
        }    
        
fclose($fichero);

?>
Abusando de tu sapiencia,
¿Cómo podría hacer para almacenar en un array la fecha, en otro las peras, en otro los limones...?

Gracias de antemano.

Última edición por jjsi; 29/05/2009 a las 12:39