Erreur parcours tableau php 4

Fermé
Léa - 26 mai 2004 à 19:28
 Gally - 26 mai 2004 à 20:23
Bonjour,

Le code suivant :

$fileOpen=fopen($fileName,"r"); 
$FileContent=fread($fileOpen,filesize($fileName)); 
$line=explode("\r",$FileContent); 
fclose($fileOpen); 

$i=0; 
while($i<sizeof($line)){  
$dataPair=explode(",",$line[$i]); 
   if($dataPair[4]=="$Number"){ 
      $match=1; 
      break;      
      }else{ 
      $match=0; 
      } 
$i++; 
} 


fait que :

à chaque lecture de la variable $dataPair, mon tableau ne recommence pas à $dataPair[0] mais à $dataPair[6].

Mon fichier texte :

$a,$b,$c,$d,$e<\r>$a,$b,$c,$d,$e<\r>.... 


Cela fait des jours que je bataille et je ne m'en sors pas...

Merci.

Léa

1 réponse

Est-ce que en metant : unset ($dataPair )
à la fin de ta boucle while ca pourait marcher ?
0