I have a long xml data file with 500+ items in it, it comes in this form:\[code\]<?xml version="1.0" encoding="ISO-8859-1"?><CATALOG><ITEM> <TITLE>ITEM name</TITLE> <TYPE>"T1", "T2", "T3" </TYPE> <DESCIPTION>DESCIPTIONiliate Page CPM</DESCIPTION> <PRICE>PRICE</PRICE> <ITEM>http://mysite.com/item-link</ITEM></ITEM></CATALOG>\[/code\]and I use the following code in the php page to import data from the xml file:\[code\]<?php$ITEMSS = new SimpleXMLElement('ITEMS.xml', null, true);echo <<<EOF<table width="100%" align="center" border="1" bordercolor="#0099ff" cellpadding="1" cellspacing="0"> <tr> <th bgcolor="#66ccff"><span class="style4">ITEM Name</span></th> <th bgcolor="#66ccff"><span class="style4">item TYPE </span></th> <th bgcolor="#66ccff"><span class="style4">item DESCIPTION </span></th> <th bgcolor="#66ccff"><span class="style4">item PRICE</span></th> <th bgcolor="#66ccff"><span class="style4">link to item</span></th> </tr>EOF;foreach($ITEMSS as $ITEMS) // loop through our DATAS{ echo <<<EOF <tr height="30" align=middle> <td><a href="http://stackoverflow.com/questions/12544985/{$ITEMS->ITEM}" target="_blank"><span class="STYLE7">{$ITEMS->TITLE}</span></a></td> <td><span class="STYLE8">{$ITEMS->TYPE}</span></td> <td><span class="STYLE8">{$ITEMS->DESCIPTION}</span></td> <td><span class="STYLE8">{$ITEMS->PRICE}</span></td> <td><a href="http://stackoverflow.com/questions/12544985/{$ITEMS->ITEM}" target="_blank"><B><span class="STYLE7">cHECK IT OUT</span></B></a></td> </tr>EOF;}echo '</table>';?>\[/code\]in the TYPE I have different values like:\[code\] <TYPE>"T1", "T2", "T3" </TYPE> <TYPE>"T1", "T4", "T6" </TYPE> <TYPE>"T1", "T8", "T1" </TYPE>\[/code\]each item may have diffrent TYPE valuesI need to add an "if" statement in the loop to select only some data if a value is in array of TYPE somethink like:\[code\]foreach($ITEMSS as $ITEMS) // loop through our DATAS{$options = array($ITEMS->TYPE);if (in_array("T1", $options)) { echo <<<EOF <tr height="30" align=middle> <td><a href="http://stackoverflow.com/questions/12544985/{$ITEMS->ITEM}" target="_blank"><span class="STYLE7">{$ITEMS->TITLE}</span></a></td> <td><span class="STYLE8">{$ITEMS->TYPE}</span></td> <td><span class="STYLE8">{$ITEMS->DESCIPTION}</span></td> <td><span class="STYLE8">{$ITEMS->PRICE}</span></td> <td><a href="http://stackoverflow.com/questions/12544985/{$ITEMS->ITEM}" target="_blank"><B><span class="STYLE7">cHECK IT OUT</span></B></a></td> </tr>EOF;}}\[/code\]but even if the value I look for is in the array , it shows nothing!.So how can I use if in array statement in this case?