<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SEOnol &#187; innerHTML</title>
	<atom:link href="http://www.seonol.com/tag/innerhtml/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.seonol.com</link>
	<description>SEO, programación, PHP... (sí, descripción nueva)</description>
	<lastBuildDate>Tue, 20 Apr 2010 08:31:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Extract the innerHTML of a DOMNode in PHP5</title>
		<link>http://www.seonol.com/2009/11/extract-the-innerhtml-of-a-domnode-in-php5/</link>
		<comments>http://www.seonol.com/2009/11/extract-the-innerhtml-of-a-domnode-in-php5/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 12:58:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[DOMDocument]]></category>
		<category><![CDATA[DOMNode]]></category>
		<category><![CDATA[innerHTML]]></category>

		<guid isPermaLink="false">http://www.seonol.com/?p=196</guid>
		<description><![CDATA[Is there an easier way to extract the innerHTML from a DOMNode in PHP5?

/**
 * Extracts the innerHTML of a DOMNode.
 *
 * The function makes a new DOMDocument, imports the DOMNode,
 * appends it to the new DOMDocument and returns the HTML of the DOMDocument
 *
 * @param   DOMNode    [...]]]></description>
			<content:encoded><![CDATA[<p>Is there an easier way to extract the innerHTML from a DOMNode in PHP5?<br />
<code><br />
/**<br />
 * Extracts the innerHTML of a DOMNode.<br />
 *<br />
 * The function makes a new DOMDocument, imports the DOMNode,<br />
 * appends it to the new DOMDocument and returns the HTML of the DOMDocument<br />
 *<br />
 * @param   DOMNode     $node   DOMNode we want to extract the innerHTML from<br />
 * @return  string              innerHTML of the node<br />
 * @author  Sergi de Pablos<br />
 */<br />
function getInnerHTML(DOMNode $node)<br />
{<br />
    try {<br />
    	// We create a new<br />
		$document = new DOMDocument();<br />
	    $newNode = $document->importNode($node,true);<br />
	    $document->appendChild($newNode);<br />
	    return $document->saveHTML();<br />
    } catch (DOMException $e) {<br />
        echo "\n" . $e->getMessage() . "\n";<br />
    }<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.seonol.com/2009/11/extract-the-innerhtml-of-a-domnode-in-php5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
