<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: How To Extract HTML Tags And Their Attributes With PHP</title>
	<atom:link href="http://w-shadow.com/blog/2009/10/20/how-to-extract-html-tags-and-their-attributes-with-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://w-shadow.com/blog/2009/10/20/how-to-extract-html-tags-and-their-attributes-with-php/</link>
	<description>Slightly Advanced Computer Stuff (and some magic)</description>
	<lastBuildDate>Fri, 19 Mar 2010 03:52:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: White Shadow</title>
		<link>http://w-shadow.com/blog/2009/10/20/how-to-extract-html-tags-and-their-attributes-with-php/comment-page-1/#comment-32263</link>
		<dc:creator>White Shadow</dc:creator>
		<pubDate>Wed, 04 Nov 2009 21:46:16 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=1375#comment-32263</guid>
		<description>When using DOM, you can get the link text like this : 
&lt;pre lang=&quot;php&quot;&gt;$text = $link-&gt;textContents;&lt;/pre&gt;
With the extract_tags() function, it&#039;s also very simple : 
&lt;pre lang=&quot;php&quot;&gt;$text = $link[&#039;contents&#039;];&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>When using DOM, you can get the link text like this :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$link</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">textContents</span><span style="color: #339933;">;</span></pre></div></div>

<p>With the extract_tags() function, it&#8217;s also very simple :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$link</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'contents'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: alex</title>
		<link>http://w-shadow.com/blog/2009/10/20/how-to-extract-html-tags-and-their-attributes-with-php/comment-page-1/#comment-32262</link>
		<dc:creator>alex</dc:creator>
		<pubDate>Wed, 04 Nov 2009 21:09:03 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=1375#comment-32262</guid>
		<description>hi, nice script, it works for me! but i&#039;m also interested in the title of a href 
example &lt;a href=&quot;http..&quot; rel=&quot;nofollow&quot;&gt; title &lt;/a&gt;
how do i get the title too ? thanks alot</description>
		<content:encoded><![CDATA[<p>hi, nice script, it works for me! but i&#8217;m also interested in the title of a href<br />
example <a href="http.." rel="nofollow"> title </a><br />
how do i get the title too ? thanks alot</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: White Shadow</title>
		<link>http://w-shadow.com/blog/2009/10/20/how-to-extract-html-tags-and-their-attributes-with-php/comment-page-1/#comment-32222</link>
		<dc:creator>White Shadow</dc:creator>
		<pubDate>Tue, 03 Nov 2009 13:17:55 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=1375#comment-32222</guid>
		<description>Fixed the script.

It was a bug in my regexp syntax. The &quot;(?&lt;name&gt;...)&quot; syntax that I used for marking named subgroups apparently only works in some versions of PHP and not others. I&#039;ve rewritten the regexps to use the proper syntax - &quot;(?&lt;strong&gt;P&lt;/strong&gt;&lt;name&gt;...)&quot;.</description>
		<content:encoded><![CDATA[<p>Fixed the script.</p>
<p>It was a bug in my regexp syntax. The &#8220;(?&lt;name&gt;&#8230;)&#8221; syntax that I used for marking named subgroups apparently only works in some versions of PHP and not others. I&#8217;ve rewritten the regexps to use the proper syntax &#8211; &#8220;(?<strong>P</strong>&lt;name&gt;&#8230;)&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zawmn83</title>
		<link>http://w-shadow.com/blog/2009/10/20/how-to-extract-html-tags-and-their-attributes-with-php/comment-page-1/#comment-32210</link>
		<dc:creator>zawmn83</dc:creator>
		<pubDate>Tue, 03 Nov 2009 07:20:36 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=1375#comment-32210</guid>
		<description>I got the following error when I tried 
$nodes = extract_tags( $string, &#039;img&#039; );

Warning: preg_match_all() [function.preg-match-all]: Compilation failed: unrecognized character after (?&lt; at offset 4 in E:\Development Documents\PHP\getattr.php on line 54
PHP Warning: preg_match_all() [function.preg-match-all]: Compilation failed: unrecognized character after (?&lt; at offset 4 in E:\Development Documents\PHP\getattr.php on line 54</description>
		<content:encoded><![CDATA[<p>I got the following error when I tried<br />
$nodes = extract_tags( $string, &#8216;img&#8217; );</p>
<p>Warning: preg_match_all() [function.preg-match-all]: Compilation failed: unrecognized character after (?&lt; at offset 4 in E:\Development Documents\PHP\getattr.php on line 54<br />
PHP Warning: preg_match_all() [function.preg-match-all]: Compilation failed: unrecognized character after (?&lt; at offset 4 in E:\Development Documents\PHP\getattr.php on line 54</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: White Shadow</title>
		<link>http://w-shadow.com/blog/2009/10/20/how-to-extract-html-tags-and-their-attributes-with-php/comment-page-1/#comment-32071</link>
		<dc:creator>White Shadow</dc:creator>
		<pubDate>Wed, 28 Oct 2009 13:56:15 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=1375#comment-32071</guid>
		<description>You&#039;re right, thanks for spotting it!</description>
		<content:encoded><![CDATA[<p>You&#8217;re right, thanks for spotting it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan</title>
		<link>http://w-shadow.com/blog/2009/10/20/how-to-extract-html-tags-and-their-attributes-with-php/comment-page-1/#comment-32070</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Wed, 28 Oct 2009 13:41:32 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=1375#comment-32070</guid>
		<description>You have line in your first example saying:
@$dom-&gt;oadHTML($html);

- I guess you mean:
@$dom-&gt;loadHTML($html);

  Regards

    Jonathan</description>
		<content:encoded><![CDATA[<p>You have line in your first example saying:<br />
@$dom-&gt;oadHTML($html);</p>
<p>- I guess you mean:<br />
@$dom-&gt;loadHTML($html);</p>
<p>  Regards</p>
<p>    Jonathan</p>
]]></content:encoded>
	</item>
</channel>
</rss>
