title: php , SimpleXML, while loop
body: <p>I'm trying to get some information from ebay api and store it in database . I used simple xml to extract the information but I have a small issue as the information is not displayed for some items . if I make a print to the simple_xml I can see very well that the information is provided by ebay api . 
  I have</p>
  
  <pre><code>$items = "220617293997,250645537939,230485306218,110537213815,180519294810";
  $number_of_items  =  count(explode(",", $items));
  $xml = $baseClass-&gt;getContent("http://open.api.ebay.com/shopping?callname=GetMultipleItems&amp;responseencoding=XML&amp;appid=Morcovar-c74b-47c0-954f-463afb69a4b3&amp;siteid=0&amp;version=525&amp;IncludeSelector=ItemSpecifics&amp;ItemID=$items");
  writeDoc($xml, "api.xml");
  //echo $xml;
  $getvalues = simplexml_load_file('api.xml');
  //  print_r($getvalue);
  $number = "0";
  
  while($number &lt; 6) {
      $item_number = $getvalues-&gt;Item[$number]-&gt;ItemID;
      $location = $getvalues-&gt;Item[$number]-&gt;Location;
      $title = $getvalues-&gt;Item[$number]-&gt;Title;
      $price = $getvalues-&gt;Item[$number]-&gt;ConvertedCurrentPrice;
      $manufacturer = $getvalues-&gt;Item[$number]-&gt;ItemSpecifics-&gt;NameValueList[3]-&gt;Value;
      $model = $getvalues-&gt;Item[$number]-&gt;ItemSpecifics-&gt;NameValueList[4]-&gt;Value;
      $mileage = $getvalues-&gt;Item[$number]-&gt;ItemSpecifics-&gt;NameValueList[5]-&gt;Value;
  
      echo "item number = $item_number &lt;br&gt;localtion = $location&lt;br&gt;".
           "title = $title&lt;br&gt;price = $price&lt;br&gt;manufacturer = $manufacturer".
           "&lt;br&gt;model = $model&lt;br&gt;mileage = $mileage&lt;br&gt;";
      $number++;
  
  }
  </code></pre>
  
  <p>the above code returns </p>
  
  <pre>
  item number =
  localtion =
  title =
  price =
  manufacturer =
  model =
  mileage =
  item number = 230485306218
  localtion = Coventry, Warwickshire
  title = 2001 LAND ROVER RANGE ROVER VOGUE AUTO GREEN
  price = 3635.07
  manufacturer = Land Rover
  model = Range Rover
  mileage = 76000
  item number = 220617293997
  localtion = Crawley, West Sussex
  title = 2004 CITROEN C5 HDI LX RED
  price = 3115.77
  manufacturer = Citroen
  model = C5
  mileage = 76000
  item number = 180519294810
  localtion = London, London
  title = 2000 VOLKSWAGEN POLO 1.4 SILVER 16V NEED GEAR BOX
  price = 905.06
  manufacturer = Right-hand drive
  model =
  mileage = Standard Car
  item number =
  localtion =
  title =
  price =
  manufacturer =
  model =
  mileage = 
  </pre>
  
  <p>As you can see the information is not retrieved for a few items ... If I replace the $number manually like " $item_number = $getvalues->Item[4]->ItemID;" works well for any number .</p>