Salut,

Voici mon code XML:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 
	 <PFIS>
	   <Supplier>
	     <name>Lufthansa Technik</name>
	     <System>
	       <name>Airtrack</name>
	       <Program>SA</Program>
	       <Compliant>Yes</Compliant>
	       <Comment></Comment>
	     </System>	       
	   </Supplier>
	   <Supplier>
	     <name>Rockwell Colins</name>
	     <System>
	       <name>Airshow 420</name>
	       <Program>SA</Program>
	       <Compliant>No</Compliant>
	       <Comment></Comment>
	     </System>
	     <System>
	       <name>Airshow 4200</name>
	       <Program>SA/LR</Program>
	       <Compliant>Yes</Compliant>
	       <Comment>Here is a comment testing</Comment>
	     </System>
	   </Supplier>
etc...
Voici mon code PHP:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
 
  echo count($Current_Product->PFIS->Supplier[0]->System). " - " ;
  echo count($Current_Product->PFIS->Supplier[1]->System) ;
Alors ca me sort 0 aux 2 count(), pas logique puisqu'il y a 2 systems pour le supplier "Rockwell Colins"

Alors que ce code PHP:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
 
  $i = 0 ;
  while($Current_Product->PFIS->Supplier[0]->System[$i]) {
    $i++ ;
  }
  echo $i ;
  $i = 0 ;
  while($Current_Product->PFIS->Supplier[1]->System[$i]) {
    $i++ ;
  }
  echo " - ".$i ;
Me sort bien une diff. entre le 1er et le second supplier !

Pourquoi count() ne marche pas ?

Merci,
Vincent.