par
jojolapine » 13 févr. 2007, 17:53
bopn finallement, il y a encore un problème....
Le preg_split me bouffe des valeurs...
Bon j'ai la chaine suivante:
id|int||1|1#nom|string|dupond|1|0#prenom|string|jean|1|0
si je fait ceci:
$temp=explode($this->separator,$temp[1]);
, j'obtient ceci avec mon print_r:
Code : Tout sélectionner
Array
(
[0] => id|int||1|1
[1] => nom|string|dupond|1|0
[2] => prenom|string|jean|1|0
) et si je fait
$temp=preg_split("'[^\\\]".$this->separator."'",$temp[1]);
j'obtient
Code : Tout sélectionner
Array
(
[0] => id|int||1|
[1] => nom|string|dupond|1|
[2] => prenom|string|jean|1|0
) en gros, le caractère juste avant $this->separator est "bouffé" par preg_split...
Ques se passe t'il docteur ?
bopn finallement, il y a encore un problème....
Le preg_split me bouffe des valeurs...
Bon j'ai la chaine suivante:[quote]id|int||1|1#nom|string|dupond|1|0#prenom|string|jean|1|0[/quote]
si je fait ceci:[php]$temp=explode($this->separator,$temp[1]);[/php], j'obtient ceci avec mon print_r:[code]Array
(
[0] => id|int||1|1
[1] => nom|string|dupond|1|0
[2] => prenom|string|jean|1|0
)[/code] et si je fait[php]$temp=preg_split("'[^\\\]".$this->separator."'",$temp[1]);[/php] j'obtient[code]Array
(
[0] => id|int||1|
[1] => nom|string|dupond|1|
[2] => prenom|string|jean|1|0
)[/code] en gros, le caractère juste avant $this->separator est "bouffé" par preg_split...
Ques se passe t'il docteur ?