par
jfa » 21 mars 2013, 13:37
Bonjour
J'ai un fichier ($filepath) au format txt qui contient des tabulations.
Or je n'arrive pas à charger ces tabulations.
J'ai le code suivant :
Code : Tout sélectionner
$arrLines= array();
$lines= file($filepath, FILE_IGNORE_NEW_LINES);
$n= count($lines);
for ($i=0; $i < $n; $i++){
$s= trim($lines[$i]);
if ($s !== ""){
$arrLines[]= $s;
}
}
$s= implode('\n', $arrLines);
Quelqu'un pourrait-il me dire ce qui ne va pas ?
Merci d'avance
Bonjour
J'ai un fichier ($filepath) au format txt qui contient des tabulations.
Or je n'arrive pas à charger ces tabulations.
J'ai le code suivant :
[code]
$arrLines= array();
$lines= file($filepath, FILE_IGNORE_NEW_LINES);
$n= count($lines);
for ($i=0; $i < $n; $i++){
$s= trim($lines[$i]);
if ($s !== ""){
$arrLines[]= $s;
}
}
$s= implode('\n', $arrLines);
[/code]
Quelqu'un pourrait-il me dire ce qui ne va pas ?
Merci d'avance