Mon tableau un espace en trop
Bonjour,
J'ai fait un var_dump de mon tableau et j'aimerai savoir pourquoi mon tableau n'est pas propre sur ma string 11 ??
VAR_DUMP
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| array
0 => string 'Allemagne' (length=9)
1 => string 'Immatriculations auto' (length=21)
2 => string 'annee' (length=5)
3 => string 'source VDA' (length=10)
4 => string 'en variation annuelle en pourcentage' (length=36)
5 => string 'automobile voiture vente' (length=24)
6 => string '' (length=0)
7 => string 'nc' (length=2)
8 => string 'nc' (length=2)
9 => string '01/01/2008' (length=10)
10 => string '-1.8' (length=4)
11 => string '%
' (length=3) |
Mon tableau que je passe à foreach
Code:
1 2 3 4 5 6 7 8 9
| array
0 => string 'Allemagne;Immatriculations auto;annee;source VDA;en variation annuelle en pourcentage;automobile voiture vente;;nc;nc;01/01/2010;-23.4;%' (length=136)
1 => string 'Allemagne;Immatriculations auto;annee;source VDA;en variation annuelle en pourcentage;automobile voiture vente;;nc;nc;01/01/2009;23.2;%
' (length=137)
2 => string 'Allemagne;Immatriculations auto;annee;source VDA;en variation annuelle en pourcentage;automobile voiture vente;;nc;nc;01/01/2008;-1.8;%
' (length=137)
3 => string 'Allemagne;Immatriculations auto;annee;source VDA;en variation annuelle en pourcentage;automobile voiture vente;;nc;nc;01/01/2007;-9.2;% |
MON CODE
Code:
1 2 3 4 5 6 7
| foreach($tab as $element)
{
$items[$o] = explode(";",$element);
var_dump($items[$o]);
$o++;
}
return($items); |
Merci :cry: ....