Hi All, I am using the below with great success. It finds for me the MIn and max values allong with the company names. The problem that has just presented itself is some of the data returned in the SLevel is text. I need to ignore text and only include numeric values. Is this possible. I have tried to work this out but have hit a brick wall.
Many thanks
Jon
$SLevels = array(); foreach ($xml->Type->Company as $item) { $companyName = (string) $item->Name; // get the company name $tmp = (array) $item->$Level; if($tmp[0] != '-') $SLevels[] = array($tmp[0], $companyName); // add SLevel and company name to array } $minSLevel = min($SLevels); // get minimum value $minSLevel[0] = str_replace(',', '', $minSLevel[0]); $premium = $minSLevel[0]; $company = $minSLevel[1];
$maxSLevel = max($SLevels); // get minimum value $maxSLevel[0] = str_replace(',', '', $maxSLevel[0]); $maxpremium = $maxSLevel[0]; $maxcompany = $maxSLevel[1];