<?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>Web-Tool.ws &#187; Snippets</title>
	<atom:link href="http://www.web-tool.ws/category/web-tools/codes/feed" rel="self" type="application/rss+xml" />
	<link>http://www.web-tool.ws</link>
	<description>Anything about world wide web</description>
	<lastBuildDate>Tue, 20 Jul 2010 06:22:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>PHP Backlink Checker</title>
		<link>http://www.web-tool.ws/seo/backlink/php-backlink-checker</link>
		<comments>http://www.web-tool.ws/seo/backlink/php-backlink-checker#comments</comments>
		<pubDate>Mon, 19 Jan 2009 01:00:35 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Backlink]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Backlink Checker]]></category>
		<category><![CDATA[php snippets]]></category>

		<guid isPermaLink="false">http://www.web-tool.ws/?p=138</guid>
		<description><![CDATA[This function is usefull for peoples with a link directory where the links are stored inside a (MySQL) database. The PHP script is easy to use to find out if a reciprocal link still exists on the corresponding webpage. It takes care about the trailing slash in urls and can be used with (almost) every [...]]]></description>
			<content:encoded><![CDATA[This function is usefull for peoples with a link directory where the links are stored inside a (MySQL) database. The PHP script is easy to use to find out if a reciprocal link still exists on the corresponding webpage. It takes care about the trailing slash in urls and can be used with (almost) every url. Inside the function is a check against a regular expression pattern and the result is a simple boolean.

CODE from: http://www.finalwebsites.com
<div style="clear: both;">
<div class="php" style="font-family: monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> check_back_link<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$remote_url</span>, <span style="color: #0000ff;">$your_link</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
<span style="color: #0000ff;">$match_pattern</span> = <a href="http://www.php.net/preg_quote"><span style="color: #000066;">preg_quote</span></a><span style="color: #66cc66;">(</span><a href="http://www.php.net/rtrim"><span style="color: #000066;">rtrim</span></a><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$your_link</span>, <span style="color: #ff0000;">&#8220;/&#8221;</span><span style="color: #66cc66;">)</span>, <span style="color: #ff0000;">&#8220;/&#8221;</span><span style="color: #66cc66;">)</span>;
<span style="color: #0000ff;">$found</span> = <span style="color: #000000; font-weight: bold;">false</span>;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">(</span><span style="color: #0000ff;">$handle</span> = @<a href="http://www.php.net/fopen"><span style="color: #000066;">fopen</span></a><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$remote_url</span>, <span style="color: #ff0000;">&#8220;r&#8221;</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
<span style="color: #b1b100;">while</span> <span style="color: #66cc66;">(</span>!<a href="http://www.php.net/feof"><span style="color: #000066;">feof</span></a><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$handle</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
<span style="color: #0000ff;">$part</span> = <a href="http://www.php.net/fread"><span style="color: #000066;">fread</span></a><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$handle</span>, <span style="color: #cc66cc;">1024</span><span style="color: #66cc66;">)</span>;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">(</span><a href="http://www.php.net/preg_match"><span style="color: #000066;">preg_match</span></a><span style="color: #66cc66;">(</span><span style="color: #ff0000;">&#8220;/&lt;a(.*)href=[<span style="color: #000099; font-weight: bold;">\"</span>']&#8220;</span>.<span style="color: #0000ff;">$match_pattern</span>.
<span style="color: #ff0000;">&#8220;(<span style="color: #000099; font-weight: bold;">\/</span>?)[<span style="color: #000099; font-weight: bold;">\"</span>'](.*)&gt;(.*)&lt;<span style="color: #000099; font-weight: bold;">\/</span>a&gt;/&#8221;</span>, <span style="color: #0000ff;">$part</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
<span style="color: #0000ff;">$found</span> = <span style="color: #000000; font-weight: bold;">true</span>;
<span style="color: #b1b100;">break</span>;
<span style="color: #66cc66;">}</span>
<span style="color: #66cc66;">}</span>
<a href="http://www.php.net/fclose"><span style="color: #000066;">fclose</span></a><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$handle</span><span style="color: #66cc66;">)</span>;
<span style="color: #66cc66;">}</span>
<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$found</span>;
<span style="color: #66cc66;">}</span>
<span style="color: #808080; font-style: italic;">// example:</span>
<span style="color: #808080; font-style: italic;">//if (check_back_link(&#8220;http://www.web-tool.ws&#8221;, &#8220;http://www.fixwordpress.net&#8221;)) echo &#8220;link exists&#8221;;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></div>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.web-tool.ws/seo/backlink/php-backlink-checker/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
