note 98242 deleted from simplexmlelement.asXML by danbrown
| From: | danbrown@php.net | Date: | Fri, 28 Jan 2011 14:32:35 +0000 |
| Subject: | note 98242 deleted from simplexmlelement.asXML by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-176436@lists.php.net to get a copy of this message | ||
Note Submitter: sovnarkom at somebugs dot com
----
1. ->children() method is just does'n work.
2. regexp method is bugie and slow.
3. consider using this nice and easy idiom:
function xml_to_html($xml, $tag) {
$search = array('<'.$tag.'>',
'</'.$tag.'>');
return str_replace($search, '', $xml->$tag->asXML());
}
xml_to_html($sxml_test, 'sometag');