<?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: Parsing html head section with empty result</title>
	<atom:link href="http://www.finalwebsites.com/blog/script-support/parsing-html-head-section-with-empty-result/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.finalwebsites.com/blog/script-support/parsing-html-head-section-with-empty-result/</link>
	<description>Discussions about PHP, jQuery, SEO &#38; general web development</description>
	<lastBuildDate>Mon, 05 Nov 2012 22:56:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Olaf</title>
		<link>http://www.finalwebsites.com/blog/script-support/parsing-html-head-section-with-empty-result/#comment-11</link>
		<dc:creator>Olaf</dc:creator>
		<pubDate>Sun, 18 Sep 2011 12:30:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.finalwebsites.com/blog/?p=129#comment-11</guid>
		<description><![CDATA[Hello,

The html parser snippet is very simple and is more an example. The validation pattern will test the meta tags for values with double quotes. If  the target page is using single quotes the regex pattern will return an empty value.

Try this pattern for the meta pattern:

&lt;pre lang=&quot;php&quot;&gt;if (eregi(&quot;&lt;meta name=[&#039;\&quot;]description[&#039;\&quot;] content=[&#039;\&quot;](.*)[&#039;\&quot;]([[:space:]]?/)?&gt;&quot;, $val, $descr)) {
            $meta_descr = $descr[1];
            $is_descr = true;
        }
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>The html parser snippet is very simple and is more an example. The validation pattern will test the meta tags for values with double quotes. If  the target page is using single quotes the regex pattern will return an empty value.</p>
<p>Try this pattern for the meta pattern:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">eregi</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;meta name=['<span style="color: #000099; font-weight: bold;">\&quot;</span>]description['<span style="color: #000099; font-weight: bold;">\&quot;</span>] content=['<span style="color: #000099; font-weight: bold;">\&quot;</span>](.*)['<span style="color: #000099; font-weight: bold;">\&quot;</span>]([[:space:]]?/)?&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$val</span><span style="color: #339933;">,</span> <span style="color: #000088;">$descr</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$meta_descr</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$descr</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$is_descr</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
	</item>
</channel>
</rss>
