I have some problems with an xml that has a a href link, that I just can't echo out in the right order.XML : \[code\]<htmlText> <TEXTFORMAT LEADING="7"> <P ALIGN="CENTER"> <FONT FACE="Arial" SIZE="12" COLOR="#333333" LETTERSPACING="0" KERNING="0"> SOME TEXT <A HREF="mailto:[email protected]" TARGET=""> <U>[email protected]</U> </A> SOME TEXT </FONT> </P> </htmlText>\[/code\]And here is the PHP part :\[code\]<!-- language: lang-php --><?php $xml = new SimpleXMLElement($xml); foreach($this->xml->htmlText as $htmltext) { foreach($htmltext as $textformat) { $line_height = $textformat->attributes()->LEADING; foreach($textformat as $p) { foreach($p as $font) { if(isset($font->A)) { foreach($font->A as $link) { $size = $link->attributes()->SIZE; $target .= $link->attributes()->TARGET; $this->build .= '<div style="width:100%; float:left; margin-left:5px; font-size:'.$size.'px;"><a href="' . str_replace("http://","",$link->attributes()->HREF) . '" target="'.$target.'" style="font-size:'.$size.'px;">'.str_replace(array("http://","mailto:"),"",$link->attributes()->HREF).'</a></div>'; } } $fontsize = $font->attributes()->SIZE; $fontfamily = str_ireplace(array('_'), array(''), $font->attributes()->FACE); $fontcolor = $font->attributes()->COLOR; $test = "1.305"; if(strlen($font) > 0) { $this->build .= '<div align="'.$this->p_attr_align.'" style="width:100%; color:'.$fontcolor.';font-family:'.$fontfamily.';font-size:'.$fontsize.'px; line-height:'.$test.'em;">'; $this->build .= iconv('UTF-8','ISO-8859-1', str_ireplace(array('','','',''), array('<b>','</b>','<i>','</i>'), $font . '</div>')); } if(strlen($font->I) > 0) { $this->build .= '<div align="'.$this->p_attr_align.'" style="width:100%; color:'.$fontcolor.';font-family:'.$fontfamily.';font-size:'.$fontsize.'px; line-height:'.$test.'em;">'; $this->build .= iconv('UTF-8','ISO-8859-1', str_ireplace(array('','','',''), array('<b>','</b>','<i>','</i>'), "<i>".$font->I . '</i></div>')); } if(strlen($font->U) > 0) { $this->build .= '<div align="'.$this->p_attr_align.'" style="width:100%; text-decoration:underline; color:'.$fontcolor.';font-family:'.$fontfamily.';font-size:'.$fontsize.'px; line-height:'.$test.'em;">'; $this->build .= iconv('UTF-8','ISO-8859-1', str_ireplace(array('','','',''), array('<b>','</b>','<i>','</i>'), "<i>".$font->U . '</i>')); $this->build .= '</div>'; } if(strlen($font) == 0 && strlen($font->U) == 0 && strlen($font->I) == 0) { $this->build .= '<div align="'.$this->p_attr_align.'" style="width:100%; text-decoration:underline; color:'.$fontcolor.';font-family:'.$fontfamily.';font-size:'.$fontsize.'px; min-height:'.$test.'em; line-height:'.$test.'em;"></div>'; } } } } } $this->build .= '</div>'; return $this->build; ?>\[/code\]The result becomes this : \[quote\]\[code\]SOME TEXTSOME TEXT<a href="mailto:[email protected]">[email protected]</a>\[/code\]\[/quote\]It should be: \[quote\] SOME TEXT [email protected] SOME TEXT\[/quote\]